Class LinkExtensions
Represents support for HTML links in an application.
public static class LinkExtensions
- Inheritance
-
LinkExtensions
- Inherited Members
Methods
ActionLink(HtmlHelper, string, string)
Returns an anchor element (a element) for the specified link text and action.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, object)
Returns an anchor element (a element) for the specified link text, action, and route values.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, object, object)
Returns an anchor element (a element) for the specified link text, action, route values, and HTML attributes.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, string)
Returns an anchor element (a element) for the specified link text, action, and controller.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
controllerName
stringThe name of the controller.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, string, object, object)
Returns an anchor element (a element) for the specified link text, action, controller, route values, and HTML attributes.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
controllerName
stringThe name of the controller.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, string, string, string, string, object, object)
Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values, and HTML attributes.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
controllerName
stringThe name of the controller.
protocol
stringThe protocol for the URL, such as "http" or "https".
hostName
stringThe host name for the URL.
fragment
stringThe URL fragment name (the anchor name).
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, string, string, string, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values as a route value dictionary, and HTML attributes as a dictionary.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
controllerName
stringThe name of the controller.
protocol
stringThe protocol for the URL, such as "http" or "https".
hostName
stringThe host name for the URL.
fragment
stringThe URL fragment name (the anchor name).
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) for the specified link text, action, controller, route values as a route value dictionary, and HTML attributes as a dictionary.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
controllerName
stringThe name of the controller.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, RouteValueDictionary)
Returns an anchor element (a element) for the specified link text, action, and route values as a route value dictionary.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
ActionLink(HtmlHelper, string, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) for the specified link text, action, route values as a route value dictionary, and HTML attributes as a dictionary.
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
actionName
stringThe name of the action.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, object)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, object routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, object, object)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, object)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, object routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, object, object)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, string, string, string, object, object)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
protocol
stringThe protocol for the URL, such as "http" or "https".
hostName
stringThe host name for the URL.
fragment
stringThe URL fragment name (the anchor name).
routeValues
objectAn object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
htmlAttributes
objectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, string, string, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
protocol
stringThe protocol for the URL, such as "http" or "https".
hostName
stringThe host name for the URL.
fragment
stringThe URL fragment name (the anchor name).
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, RouteValueDictionary)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeName
stringThe name of the route that is used to return a virtual path.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, RouteValueDictionary)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.
RouteLink(HtmlHelper, string, RouteValueDictionary, IDictionary<string, object>)
Returns an anchor element (a element) that contains the virtual path of the specified action.
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelper
HtmlHelperThe HTML helper instance that this method extends.
linkText
stringThe inner text of the anchor element.
routeValues
RouteValueDictionaryAn object that contains the parameters for a route.
htmlAttributes
IDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An anchor element (a element).
Exceptions
- ArgumentException
The
linkText
parameter is null or empty.