mvc html.routelink,LinkExtensions.RouteLink Method (System.Web.Mvc.Html) | Microsoft Docs

LinkExtensions.RouteLink Method

Definition

Assembly:System.Web.Mvc.dll

Package:Microsoft.AspNet.Mvc v5.2.6

In this article

Overloads

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

Returns an anchor element (a element) that contains the virtual path of the specified action.

RouteLink(HtmlHelper, String, String, RouteValueDictionary, IDictionary)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * System.Web.Routing.RouteValueDictionary * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, routeValues As RouteValueDictionary, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

An object that contains the parameters for a route.

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, String, Object, Object)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, object routeValues, object htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * obj * obj -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, routeValues As Object, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

routeValues

An 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

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, RouteValueDictionary, IDictionary)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * System.Web.Routing.RouteValueDictionary * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeValues As RouteValueDictionary, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

An object that contains the parameters for a route.

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, String, RouteValueDictionary)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, System.Web.Routing.RouteValueDictionary routeValues);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * System.Web.Routing.RouteValueDictionary -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, routeValues As RouteValueDictionary) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

An object that contains the parameters for a route.

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, Object)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, object routeValues);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * obj -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeValues As Object) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeValues

An 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

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, Object, Object)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, object routeValues, object htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * obj * obj -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeValues As Object, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeValues

An 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

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, RouteValueDictionary)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, System.Web.Routing.RouteValueDictionary routeValues);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * System.Web.Routing.RouteValueDictionary -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeValues As RouteValueDictionary) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

An object that contains the parameters for a route.

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, String)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

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 System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * string * string * string * obj * obj -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, protocol As String, hostName As String, fragment As String, routeValues As Object, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

protocol

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

hostName

The host name for the URL.

fragment

The URL fragment name (the anchor name).

routeValues

An 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

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, String, Object)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, object routeValues);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * obj -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, routeValues As Object) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

routeValues

An 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

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

RouteLink(HtmlHelper, String, String, String, String, String, RouteValueDictionary, IDictionary)

Returns an anchor element (a element) that contains the virtual path of the specified action.

public static System.Web.Mvc.MvcHtmlString RouteLink (this System.Web.Mvc.HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary htmlAttributes);

static member RouteLink : System.Web.Mvc.HtmlHelper * string * string * string * string * string * System.Web.Routing.RouteValueDictionary * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString

Public Function RouteLink (htmlHelper As HtmlHelper, linkText As String, routeName As String, protocol As String, hostName As String, fragment As String, routeValues As RouteValueDictionary, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper

The HTML helper instance that this method extends.

linkText

The inner text of the anchor element.

routeName

The name of the route that is used to return a virtual path.

protocol

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

hostName

The host name for the URL.

fragment

The URL fragment name (the anchor name).

An object that contains the parameters for a route.

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

Returns

An anchor element (a element).

Exceptions

The linkText parameter is null or empty.

Applies to

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值