AjaxHelper<TModel> Class

 

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

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

Inheritance Hierarchy

System.Object
  System.Web.Mvc.AjaxHelper
    System.Web.Mvc.AjaxHelper<TModel>

Syntax

public class AjaxHelper<TModel> : AjaxHelper
generic<typename TModel>
public ref class AjaxHelper : AjaxHelper
type AjaxHelper<'TModel> = 
    class
        inherit AjaxHelper
    end
Public Class AjaxHelper(Of TModel)
    Inherits AjaxHelper

Type Parameters

  • TModel
    The type of the model.

Constructors

Name Description
System_CAPS_pubmethod AjaxHelper<TModel>(ViewContext, IViewDataContainer)

Initializes a new instance of the AjaxHelper<TModel> class by using the specified view context and view data container.

System_CAPS_pubmethod AjaxHelper<TModel>(ViewContext, IViewDataContainer, RouteCollection)

Initializes a new instance of the AjaxHelper<TModel> class by using the specified view context, view data container, and URL route collection.

Properties

Name Description
System_CAPS_pubproperty RouteCollection

Gets the collection of URL routes for the application.(Inherited from AjaxHelper.)

System_CAPS_pubproperty ViewBag

Gets the ViewBag.

System_CAPS_pubproperty ViewContext

Gets the context information about the view.(Inherited from AjaxHelper.)

System_CAPS_pubproperty ViewData

Gets the strongly typed version of the view data dictionary.

System_CAPS_pubproperty ViewDataContainer

Gets the view data container.(Inherited from AjaxHelper.)

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod JavaScriptStringEncode(String)

Serializes the specified message and returns the resulting JSON-formatted string.(Inherited from AjaxHelper.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Extension Methods

Name Description
System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod ActionLink(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.)

System_CAPS_pubmethod BeginForm(AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, Object, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, Object, AjaxOptions, Object)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, RouteValueDictionary, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)

Overloaded. Writes an opening <form> tag to the response. (Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, String, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, String, Object, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, String, Object, AjaxOptions, Object)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, String, RouteValueDictionary, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginForm(String, String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)

Overloaded. Writes an opening <form> tag to the response.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginRouteForm(String, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response using the specified routing information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginRouteForm(String, Object, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response using the specified routing information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginRouteForm(String, Object, AjaxOptions, Object)

Overloaded. Writes an opening <form> tag to the response using the specified routing information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginRouteForm(String, RouteValueDictionary, AjaxOptions)

Overloaded. Writes an opening <form> tag to the response using the specified routing information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod BeginRouteForm(String, RouteValueDictionary, AjaxOptions, IDictionary<String, Object>)

Overloaded. Writes an opening <form> tag to the response using the specified routing information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod GlobalizationScript()

Overloaded. Returns an HTML script element that contains a reference to a globalization script that defines the culture information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod GlobalizationScript(CultureInfo)

Overloaded. Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information.(Defined by AjaxExtensions.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

System_CAPS_pubmethod RouteLink(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.)

Remarks

The AjaxHelper<TModel> class is a strongly typed class that derives from the AjaxHelper class. 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 by 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 call the ActionLink method in your view using the following syntax

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

Thread Safety

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

See Also

System.Web.Mvc Namespace

Return to top