Fork me on GitHub

MvcAjaxOptionsBuilder class

Represents a MvcAjaxOptions builder that is used to create the MvcAjaxOptions object.
Constructors:
NameDescription
MvcAjaxOptionsBuilder(MvcAjaxOptions ajaxOptions) Initializes a new instance of the MvcAjaxOptionsBuilder class using the specified MvcAjaxOptions object.
Public methods:
NameDescription
DisableHistorySupport()Disables the browser history support, it's equivalent of setting MvcAjaxOptions.EnableHistorySupport to false.
DisallowCache()Disables the client cache, it's equivalent of setting MvcAjaxOptions.AllowCache to false.
EnablePartialLoading()Sets a value indicating whether partial page loading is enabled, it's equivalent of setting MvcAjaxOptions.EnablePartialLoading to true.
SetConfirm(string confirm)Sets the message to display in a confirmation window before a request is submitted, it's equivalent of setting MvcAjaxOptions.Confirm to the given value.
SetDataFormId(string id)Sets the ID of the form element that values of fields should be passed to server by MvcPager every time page changed, it's equivalent of setting MvcAjaxOptions.DataFormId to the given value.
SetHttpMethod(string method)Sets the HTTP request method ("Get" or "Post"), it's equivalent of setting MvcAjaxOptions.HttpMethod to the given value.
SetLoadingElementDuration(int duration)Sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element, it's equivalent of setting MvcAjaxOptions.LoadingElementDuration to the given value.
SetLoadingElementId(string id)Sets the id attribute of an HTML element that is displayed while the Ajax function is loading, it's equivalent of setting MvcAjaxOptions.LoadingElementId to the given value.
SetOnBegin(string name)Sets the name of the JavaScript function to call immediately before the page is updated, it's equivalent of setting MvcAjaxOptions.OnBegin to the given value.
SetOnComplete(string name)Sets the JavaScript function to call when response data has been instantiated but before the page is updated, it's equivalent of setting MvcAjaxOptions.OnComplete to the given value.
SetOnFailure(string name)Sets the JavaScript function to call if the page update fails, it's equivalent of setting MvcAjaxOptions.OnFailure to the given value.
SetOnSuccess(string name)Sets the JavaScript function to call after the page is successfully updated, it's equivalent of setting MvcAjaxOptions.OnSuccess to the given value.
SetUpdateTargetId(string targetId)Sets sets the ID of the DOM element to update by using the response from the server, it's equivalent of setting MvcAjaxOptions.UpdateTargetId to the given value.
Note: In order to enable method chaining, the return value of all public methods are MvcAjaxOptionsBuilder.