Share via


UrlHelper.Action Method

Definition

Overloads

Action()

Generates a string to a fully qualified URL to an action method.

Action(String)

Generates a fully qualified URL to an action method by using the specified action name.

Action(String, Object)

Generates a fully qualified URL to an action method by using the specified action name and route values.

Action(String, String)

Generates a fully qualified URL to an action method by using the specified action name and controller name.

Action(String, RouteValueDictionary)

Generates a fully qualified URL to an action method for the specified action name and route values.

Action(String, String, Object)

Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.

Action(String, String, RouteValueDictionary)

Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.

Action(String, String, Object, String)

Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use.

Action(String, String, RouteValueDictionary, String)

Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, and protocol to use.

Action(String, String, RouteValueDictionary, String, String)

Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use and host name.

Action()

Generates a string to a fully qualified URL to an action method.

public virtual string Action ();
abstract member Action : unit -> string
override this.Action : unit -> string
Public Overridable Function Action () As String

Returns

A string to a fully qualified URL to an action method.

Applies to

Action(String)

Generates a fully qualified URL to an action method by using the specified action name.

public virtual string Action (string actionName);
abstract member Action : string -> string
override this.Action : string -> string
Public Overridable Function Action (actionName As String) As String

Parameters

actionName
String

The name of the action method.

Returns

The fully qualified URL to an action method.

Applies to

Action(String, Object)

Generates a fully qualified URL to an action method by using the specified action name and route values.

public virtual string Action (string actionName, object routeValues);
abstract member Action : string * obj -> string
override this.Action : string * obj -> string
Public Overridable Function Action (actionName As String, routeValues As Object) As String

Parameters

actionName
String

The name of the action method.

routeValues
Object

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

The fully qualified URL to an action method.

Applies to

Action(String, String)

Generates a fully qualified URL to an action method by using the specified action name and controller name.

public virtual string Action (string actionName, string controllerName);
abstract member Action : string * string -> string
override this.Action : string * string -> string
Public Overridable Function Action (actionName As String, controllerName As String) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

Returns

The fully qualified URL to an action method.

Applies to

Action(String, RouteValueDictionary)

Generates a fully qualified URL to an action method for the specified action name and route values.

public virtual string Action (string actionName, System.Web.Routing.RouteValueDictionary routeValues);
abstract member Action : string * System.Web.Routing.RouteValueDictionary -> string
override this.Action : string * System.Web.Routing.RouteValueDictionary -> string
Public Overridable Function Action (actionName As String, routeValues As RouteValueDictionary) As String

Parameters

actionName
String

The name of the action method.

routeValues
RouteValueDictionary

An object that contains the parameters for a route.

Returns

The fully qualified URL to an action method.

Applies to

Action(String, String, Object)

Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.

public virtual string Action (string actionName, string controllerName, object routeValues);
abstract member Action : string * string * obj -> string
override this.Action : string * string * obj -> string
Public Overridable Function Action (actionName As String, controllerName As String, routeValues As Object) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
Object

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

The fully qualified URL to an action method.

Applies to

Action(String, String, RouteValueDictionary)

Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.

public virtual string Action (string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues);
abstract member Action : string * string * System.Web.Routing.RouteValueDictionary -> string
override this.Action : string * string * System.Web.Routing.RouteValueDictionary -> string
Public Overridable Function Action (actionName As String, controllerName As String, routeValues As RouteValueDictionary) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
RouteValueDictionary

An object that contains the parameters for a route.

Returns

The fully qualified URL to an action method.

Applies to

Action(String, String, Object, String)

Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use.

public virtual string Action (string actionName, string controllerName, object routeValues, string protocol);
abstract member Action : string * string * obj * string -> string
override this.Action : string * string * obj * string -> string
Public Overridable Function Action (actionName As String, controllerName As String, routeValues As Object, protocol As String) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
Object

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.

protocol
String

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

Returns

The fully qualified URL to an action method.

Applies to

Action(String, String, RouteValueDictionary, String)

Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, and protocol to use.

public virtual string Action (string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues, string protocol);
abstract member Action : string * string * System.Web.Routing.RouteValueDictionary * string -> string
override this.Action : string * string * System.Web.Routing.RouteValueDictionary * string -> string
Public Overridable Function Action (actionName As String, controllerName As String, routeValues As RouteValueDictionary, protocol As String) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
RouteValueDictionary

An object that contains the parameters for a route.

protocol
String

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

Returns

The fully qualified URL to an action method.

Applies to

Action(String, String, RouteValueDictionary, String, String)

Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use and host name.

public virtual string Action (string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues, string protocol, string hostName);
abstract member Action : string * string * System.Web.Routing.RouteValueDictionary * string * string -> string
override this.Action : string * string * System.Web.Routing.RouteValueDictionary * string * string -> string
Public Overridable Function Action (actionName As String, controllerName As String, routeValues As RouteValueDictionary, protocol As String, hostName As String) As String

Parameters

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
RouteValueDictionary

An object that contains the parameters for a route.

protocol
String

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

hostName
String

The host name for the URL.

Returns

The fully qualified URL to an action method.

Applies to