Table of Contents

Class AjaxExtensions

Namespace
System.Web.Mvc.Ajax
Assembly
System.Web.Mvc.dll

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

public static class AjaxExtensions
Inheritance
AjaxExtensions
Inherited Members

Methods

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

protocol string

The protocol for the URL, such as "http" or "https".

hostName string

The host name for the URL.

fragment string

The URL fragment name (the anchor name).

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

protocol string

The protocol for the URL, such as "http" or "https".

hostName string

The host name for the URL.

fragment string

The URL fragment name (the anchor name).

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

controllerName string

The name of the controller.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

actionName string

The name of the action method.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

BeginForm(AjaxHelper, string, object, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, object, AjaxOptions, object)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, string, object, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

controllerName string

The name of the controller.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, string, object, AjaxOptions, object)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

controllerName string

The name of the controller.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, string, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

controllerName string

The name of the controller.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, string, RouteValueDictionary, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

controllerName string

The name of the controller.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, string, RouteValueDictionary, AjaxOptions, IDictionary<string, object>)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

controllerName string

The name of the controller.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, RouteValueDictionary, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, string, RouteValueDictionary, AjaxOptions, IDictionary<string, object>)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

actionName string

The name of the action method that will handle the request.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element..

Returns

MvcForm

An opening <form> tag.

BeginForm(AjaxHelper, AjaxOptions)

Writes an opening <form> tag to the response.

public static MvcForm BeginForm(this AjaxHelper ajaxHelper, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginRouteForm(AjaxHelper, string, object, AjaxOptions)

Writes an opening <form> tag to the response using the specified routing information.

public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

routeName string

The name of the route to use to obtain the form post URL.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginRouteForm(AjaxHelper, string, object, AjaxOptions, object)

Writes an opening <form> tag to the response using the specified routing information.

public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

routeName string

The name of the route to use to obtain the form post URL.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcForm

An opening <form> tag.

BeginRouteForm(AjaxHelper, string, AjaxOptions)

Writes an opening <form> tag to the response using the specified routing information.

public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

routeName string

The name of the route to use to obtain the form post URL.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginRouteForm(AjaxHelper, string, RouteValueDictionary, AjaxOptions)

Writes an opening <form> tag to the response using the specified routing information.

public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

routeName string

The name of the route to use to obtain the form post URL.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcForm

An opening <form> tag.

BeginRouteForm(AjaxHelper, string, RouteValueDictionary, AjaxOptions, IDictionary<string, object>)

Writes an opening <form> tag to the response using the specified routing information.

public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

routeName string

The name of the route to use to obtain the form post URL.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcForm

An opening <form> tag.

GlobalizationScript(AjaxHelper)

Returns an HTML script element that contains a reference to a globalization script that defines the culture information.

public static MvcHtmlString GlobalizationScript(this AjaxHelper ajaxHelper)

Parameters

ajaxHelper AjaxHelper

The AJAX helper object that this method extends.

Returns

MvcHtmlString

A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script>

GlobalizationScript(AjaxHelper, CultureInfo)

Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information.

public static MvcHtmlString GlobalizationScript(this AjaxHelper ajaxHelper, CultureInfo cultureInfo)

Parameters

ajaxHelper AjaxHelper

The AJAX helper object that this method extends.

cultureInfo CultureInfo

Encapsulates information about the target culture, such as date formats.

Returns

MvcHtmlString

An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script>

Exceptions

ArgumentNullException

The cultureInfo parameter is null.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, object routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

routeValues object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

protocol string

The protocol for the URL, such as "http" or "https".

hostName string

The host name for the URL.

fragment string

The URL fragment name (the anchor name).

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions, object htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeName string

The name of the route to use to obtain the form post URL.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, RouteValueDictionary routeValues, AjaxOptions ajaxOptions)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.

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 static MvcHtmlString RouteLink(this AjaxHelper ajaxHelper, string linkText, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)

Parameters

ajaxHelper AjaxHelper

The AJAX helper.

linkText string

The inner text of the anchor element.

routeValues RouteValueDictionary

An object that contains the parameters for a route.

ajaxOptions AjaxOptions

An object that provides options for the asynchronous request.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An anchor element.

Exceptions

ArgumentException

The linkText parameter is null or empty.