AjaxExtensions Class
Represents support for ASP.NET AJAX within an ASP.NET MVC application.
Namespace: System.Web.Mvc.Ajax
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | ActionLink(AjaxHelper, String, String, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, Object, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, Object, AjaxOptions, Object) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, Object, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, RouteValueDictionary, AjaxOptions) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, Object, AjaxOptions, Object) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, String, String, String, Object, AjaxOptions, Object) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | ActionLink(AjaxHelper, String, String, String, String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. |
![]() ![]() | BeginForm(AjaxHelper, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, Object, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, String, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, Object, AjaxOptions, Object) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, String, Object, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, String, Object, AjaxOptions, Object) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginForm(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Writes an opening <form> tag to the response. |
![]() ![]() | BeginRouteForm(AjaxHelper, String, AjaxOptions) | Writes an opening <form> tag to the response using the specified routing information. |
![]() ![]() | BeginRouteForm(AjaxHelper, String, Object, AjaxOptions) | Writes an opening <form> tag to the response using the specified routing information. |
![]() ![]() | BeginRouteForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions) | Writes an opening <form> tag to the response using the specified routing information. |
![]() ![]() | BeginRouteForm(AjaxHelper, String, Object, AjaxOptions, Object) | Writes an opening <form> tag to the response using the specified routing information. |
![]() ![]() | BeginRouteForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Writes an opening <form> tag to the response using the specified routing information. |
![]() ![]() | GlobalizationScript(AjaxHelper) | Returns an HTML script element that contains a reference to a globalization script that defines the culture information. |
![]() ![]() | GlobalizationScript(AjaxHelper, CultureInfo) | Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. |
![]() ![]() | RouteLink(AjaxHelper, String, Object, AjaxOptions) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, AjaxOptions) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, RouteValueDictionary, AjaxOptions) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, Object, AjaxOptions, Object) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, Object, AjaxOptions) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, AjaxOptions, Object) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, Object, AjaxOptions, Object) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
![]() ![]() | RouteLink(AjaxHelper, String, String, String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>) | Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. |
The AjaxExtensions class contains methods that extend the AjaxHelper class. Each extension method renders an HTML element. The ActionLink method renders an anchor (a) element that links to an action method. The RouteLink method renders an anchor (a) element that links to a URL, which can resolve to an action method, a file, a folder, or some other resource. This class also contains BeginForm and BeginRouteForm methods that help you create HTML forms that are supported by AJAX functions.
The following example shows a view that calls the ActionLink method, the BeginRouteForm method, the BeginForm method, and the BeginRouteForm method. The ActionLink method links to an action method that updates a status message that contains a time stamp. The RouteLink method links to the same action method and updates a second status message. The BeginForm method creates a form that contains a text box where the user can enter a message that is displayed with the time the message was entered. The BeginRouteForm method creates a second form that also contains a text box for entering a message.
To support AJAX in the view, the following script references must be added to the master view.
<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script> <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
The following example shows the HomeController class that supports the view that is listed in the previous example. The GetStatus method is called by both the ActionLink and RouteLink methods and returns a status string. The UpdateForm method is called when the form created by BeginForm is submitted. This method returns a message to be displayed. The UpdateRouteForm method is called when the form that is created by BeginRouteForm is submitted. This method also returns a message to display.
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)