Export (0) Print
Expand All

AjaxHelper Class

Represents support for rendering HTML in AJAX scenarios within a view.

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

public class AjaxHelper

The AjaxHelper type exposes the following members.

  NameDescription
Public methodAjaxHelper(ViewContext, IViewDataContainer)Initializes a new instance of the AjaxHelper class using the specified view context and view data container.
Public methodAjaxHelper(ViewContext, IViewDataContainer, RouteCollection)Initializes a new instance of the AjaxHelper class by using the specified view context, view data container, and route collection.
Top

  NameDescription
Public propertyStatic memberGlobalizationScriptPathGets or sets the root path for the location to use for globalization script files.
Public propertyRouteCollectionGets the collection of URL routes for the application.
Public propertyViewBagGets the ViewBag.
Public propertyViewContextGets the context information about the view.
Public propertyViewDataGets the current view data dictionary.
Public propertyViewDataContainerGets the view data container.
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodJavaScriptStringEncodeSerializes the specified message and returns the resulting JSON-formatted string.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top

  NameDescription
Public Extension MethodActionLink(String, String, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, Object, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, RouteValueDictionary, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, Object, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, Object, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, RouteValueDictionary, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, Object, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, String, String, String, Object, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodActionLink(String, String, String, String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, Object, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, RouteValueDictionary, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, String, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, Object, AjaxOptions, Object)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, String, Object, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, String, RouteValueDictionary, AjaxOptions)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, String, Object, AjaxOptions, Object)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginForm(String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)
Public Extension MethodBeginResourceForm(String, Object, AjaxOptions)Overloaded. Generates the Form preamble, defaulting the link for the Retrieve action. (Defined by AjaxHelperExtensions.)
Public Extension MethodBeginResourceForm(String, Object, AjaxOptions, ActionType)Overloaded. Generates the Form preamble. (Defined by AjaxHelperExtensions.)
Public Extension MethodBeginRouteForm(String, AjaxOptions)Overloaded. Writes an opening <form> tag to the response using the specified routing information. (Defined by AjaxExtensions.)
Public Extension MethodBeginRouteForm(String, Object, AjaxOptions)Overloaded. Writes an opening <form> tag to the response using the specified routing information. (Defined by AjaxExtensions.)
Public Extension MethodBeginRouteForm(String, RouteValueDictionary, AjaxOptions)Overloaded. Writes an opening <form> tag to the response using the specified routing information. (Defined by AjaxExtensions.)
Public Extension MethodBeginRouteForm(String, Object, AjaxOptions, Object)Overloaded. Writes an opening <form> tag to the response using the specified routing information. (Defined by AjaxExtensions.)
Public Extension MethodBeginRouteForm(String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. Writes an opening <form> tag to the response using the specified routing information. (Defined by AjaxExtensions.)
Public Extension MethodGlobalizationScript()Overloaded. Returns an HTML script element that contains a reference to a globalization script that defines the culture information. (Defined by AjaxExtensions.)
Public Extension MethodGlobalizationScript(CultureInfo)Overloaded. Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. (Defined by AjaxExtensions.)
Public Extension MethodResourceLink(String, Object, AjaxOptions)Overloaded. Generates a link to the resource controller, defaulting to the Retrieve action. (Defined by AjaxHelperExtensions.)
Public Extension MethodResourceLink(String, String, Object, AjaxOptions)Overloaded. Generates a link to the resource controller, defaulting to the Retrieve action. (Defined by AjaxHelperExtensions.)
Public Extension MethodResourceLink(String, String, Object, AjaxOptions, ActionType)Overloaded. Generates a link to the resource controller. (Defined by AjaxHelperExtensions.)
Public Extension MethodRouteLink(String, Object, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, RouteValueDictionary, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, Object, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, Object, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, RouteValueDictionary, AjaxOptions)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, Object, AjaxOptions, Object)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Public Extension MethodRouteLink(String, String, String, String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)Overloaded. 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. (Defined by AjaxExtensions.)
Top

The AjaxHelper class includes methods that provide client-side functionality in ASP.NET AJAX in MVC applications, such as creating asynchronous forms and rendering links. The AjaxHelper class supports asynchronous partial-page updates. Extensions to the AjaxHelper class are in the System.Web.Mvc.Ajax namespace.

Helper methods and extensions are called using the Ajax property of the view, which is an instance of the AjaxHelper class. For example, to generate a link to a controller action method, you can call the ActionLink method in your view using the following syntax:

<%= Ajax.ActionLink("ActionName") %>

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