Export (0) Print
Expand All

AjaxExtensions Class

Represents support for ASP.NET AJAX within an ASP.NET MVC application.

System.Object
  System.Web.Mvc.Ajax.AjaxExtensions

Namespace:  System.Web.Mvc.Ajax
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public final class AjaxExtensions

  NameDescription
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberActionLink(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.
Public methodStatic memberBeginForm(AjaxHelper, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, Object, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, String, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, Object, AjaxOptions, Object)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, String, Object, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions, IDictionary(String, Object))Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, String, Object, AjaxOptions, Object)Writes an opening <form> tag to the response.
Public methodStatic memberBeginForm(AjaxHelper, String, String, RouteValueDictionary, AjaxOptions, IDictionary(String, Object))Writes an opening <form> tag to the response.
Public methodStatic memberBeginRouteForm(AjaxHelper, String, AjaxOptions)Writes an opening <form> tag to the response using the specified routing information.
Public methodStatic memberBeginRouteForm(AjaxHelper, String, Object, AjaxOptions)Writes an opening <form> tag to the response using the specified routing information.
Public methodStatic memberBeginRouteForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions)Writes an opening <form> tag to the response using the specified routing information.
Public methodStatic memberBeginRouteForm(AjaxHelper, String, Object, AjaxOptions, Object)Writes an opening <form> tag to the response using the specified routing information.
Public methodStatic memberBeginRouteForm(AjaxHelper, String, RouteValueDictionary, AjaxOptions, IDictionary(String, Object))Writes an opening <form> tag to the response using the specified routing information.
Public methodStatic memberGlobalizationScript(AjaxHelper)Returns an HTML script element that contains a reference to a globalization script that defines the culture information.
Public methodStatic memberGlobalizationScript(AjaxHelper, CultureInfo)Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Public methodStatic memberRouteLink(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.
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft