Is it possible to modify certain MVC Ajax Form parameters like InsertionMode
or LoadingElementId
using client-side javascript?
If so, how can this be achieved?
Here is an example of a MVC ajax form :
@using (Ajax.BeginRouteForm("DevicesByObjectName", new AjaxOptions
{
InsertionMode = InsertionMode.InsertBefore,
UpdateTargetId = "Devices",
LoadingElementId = "LoaderContents",
OnSuccess = "MoreDevicesOnSuccess",
OnFailure = "MoreDevicesOnFailure",
OnBegin = "MoreDevicesOnBegin",
OnComplete = "MoreDevicesOnComplete",
}))
{
<div>
@Html.AntiForgeryToken()
<input type="hidden" value="@Model.Object.Id" id="ObjectId" name="ObjectId" />
<input type="hidden" value="2" id="PageNumber" name="PageNumber" />
<input type="hidden" value="" id="Filtering" name="Filtering" />
<div class="center-block" style="max-width: 360px;">
<input type="submit" value=" more" class="btn btn-primary btn-lg btn-block center-block" />
</div>
<div id="LoaderContents" class="ajax-loader center-block hidden"></div>
</div>
}