HtmlHelper.GenerateRouteLink HtmlHelper.GenerateRouteLink Method

Definition

Overloads

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

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

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

Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment.

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

public static string GenerateRouteLink (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteCollection routeCollection, string linkText, string routeName, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member GenerateRouteLink : System.Web.Routing.RequestContext * System.Web.Routing.RouteCollection * string * string * System.Web.Routing.RouteValueDictionary * System.Collections.Generic.IDictionary<string, obj> -> string

Parameters

requestContext
RequestContext RequestContext

The context of the HTTP request.

routeCollection
RouteCollection RouteCollection

The collection of URL routes.

linkText
String String

The text caption to display for the link.

routeName
String String

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

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes for the element.

Returns

An HTML element that links to the specified URL route.

Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment.

public static string GenerateRouteLink (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteCollection routeCollection, string linkText, string routeName, string protocol, string hostName, string fragment, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member GenerateRouteLink : System.Web.Routing.RequestContext * System.Web.Routing.RouteCollection * string * string * string * string * string * System.Web.Routing.RouteValueDictionary * System.Collections.Generic.IDictionary<string, obj> -> string

Parameters

requestContext
RequestContext RequestContext

The context of the HTTP request.

routeCollection
RouteCollection RouteCollection

The collection of URL routes.

linkText
String String

The text caption to display for the link.

routeName
String String

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

protocol
String String

The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP.

hostName
String String

The name of the host.

fragment
String String

The fragment identifier.

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes for the element.

Returns

An HTML element that links to the specified URL route.

Applies to