Delen via


HtmlHelper.GenerateRouteLink Method (RequestContext, RouteCollection, String, String, RouteValueDictionary, IDictionary<String, Object>)

Generates an HTML anchor element (a element) that links to the specified URL route.

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

Syntax

'Declaration
Public Shared Function GenerateRouteLink ( _
    requestContext As RequestContext, _
    routeCollection As RouteCollection, _
    linkText As String, _
    routeName As String, _
    routeValues As RouteValueDictionary, _
    htmlAttributes As IDictionary(Of String, Object) _
) As String
public static string GenerateRouteLink(
    RequestContext requestContext,
    RouteCollection routeCollection,
    string linkText,
    string routeName,
    RouteValueDictionary routeValues,
    IDictionary<string, Object> htmlAttributes
)
public:
static String^ GenerateRouteLink(
    RequestContext^ requestContext, 
    RouteCollection^ routeCollection, 
    String^ linkText, 
    String^ routeName, 
    RouteValueDictionary^ routeValues, 
    IDictionary<String^, Object^>^ htmlAttributes
)

Parameters

  • linkText
    Type: System.String
    The text caption to display for the link.
  • routeName
    Type: System.String
    The name of the route that is used to return a virtual path.

Return Value

Type: System.String
An HTML element that links to the specified URL route.

See Also

Reference

HtmlHelper Class

GenerateRouteLink Overload

System.Web.Mvc Namespace