HtmlHelper.GenerateLink HtmlHelper.GenerateLink Method

Definition

Overloads

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

Generates an HTML anchor element (a element) that links to the specified action method.

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

Generates an HTML anchor element (a element) that links to the specified action method, 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 action method.

public static string GenerateLink (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteCollection routeCollection, string linkText, string routeName, string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member GenerateLink : System.Web.Routing.RequestContext * System.Web.Routing.RouteCollection * 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.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

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 action method.

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

public static string GenerateLink (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteCollection routeCollection, string linkText, string routeName, string actionName, string controllerName, string protocol, string hostName, string fragment, System.Web.Routing.RouteValueDictionary routeValues, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member GenerateLink : System.Web.Routing.RequestContext * System.Web.Routing.RouteCollection * string * string * 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.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

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 action method.

Applies to