AjaxOptions AjaxOptions AjaxOptions Class


Represents option settings for running Ajax scripts in an ASP.NET MVC application.

public class AjaxOptions
type AjaxOptions = class
Public Class AjaxOptions


AjaxOptions() AjaxOptions() AjaxOptions()

Initializes a new instance of the AjaxOptions class.


AllowCache AllowCache AllowCache
Confirm Confirm Confirm

Gets or sets the message to display in a confirmation window before a request is submitted.

HttpMethod HttpMethod HttpMethod

Gets or sets the HTTP request method ("Get" or "Post").

InsertionMode InsertionMode InsertionMode

Gets or sets the mode that specifies how to insert the response into the target DOM element.

LoadingElementDuration LoadingElementDuration LoadingElementDuration

Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element.

LoadingElementId LoadingElementId LoadingElementId

Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading.

OnBegin OnBegin OnBegin

Gets or sets the name of the JavaScript function to call immediately before the page is updated.

OnComplete OnComplete OnComplete

Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated.

OnFailure OnFailure OnFailure

Gets or sets the JavaScript function to call if the page update fails.

OnSuccess OnSuccess OnSuccess

Gets or sets the JavaScript function to call after the page is successfully updated.

UpdateTargetId UpdateTargetId UpdateTargetId

Gets or sets the ID of the DOM element to update by using the response from the server.

Url Url Url

Gets or sets the URL to make the request to.


ToUnobtrusiveHtmlAttributes() ToUnobtrusiveHtmlAttributes() ToUnobtrusiveHtmlAttributes()

Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript.

Applies to