I have specified the Action method to use for the Async request with Url.Action, but unlike with specifying the ajax options for a form and storing them i.e
AjaxOptions ajaxOpts = new AjaxOptions {
UpdateTargetId = "tabledata",
Url = Url.Action("AppointmentData")
};
And than just passing this "ajaxOpts" into the Ajax.BeginForm() I am unable to store the ajax options in a variable and than pass that into Ajax.ActionLink. Please see the syntax I am attempting below:
@Ajax.ActionLink(cat.CATNAME, ajaxOpts, new { CatID = cat.CATID, count = Model.Count },
AjaxOptions ajaxOpts = new AjaxOptions
{
UpdateTargetId = "catlist-" + Model.Count,
Url = Url.Action("GetCats")
})
Whilst something like the below without trying to use graceful degradation works fine of course, but with jscript turned off it just emits the partialview without the rest of the page:
@Ajax.ActionLink(cat.CATNAME, "GetCats", new { CatID = cat.CATID, count = Model.Count },
new AjaxOptions
{
UpdateTargetId = "catlist-" + Model.Count,
})
It's understandable that when you don't specify the URL for the form and instead just use AjaxOptions as a parameter and jscript is turned off the form will just by default post back to the Action that rendered the page. But is something similar possible for the ActionLink ?