UrlHelperExtensions Class¶
Methods¶
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper)¶ Generates a fully qualified or absolute URL for an action method.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String) Generates a fully qualified or absolute URL for an action method by using the specified action name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.Object) Generates a fully qualified or absolute URL for an action method by using the specified action name, and route values.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- values (System.Object) – An object that contains route values.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, object values)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.String) Generates a fully qualified or absolute URL for an action method by using the specified action name, and controller name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- controller (System.String) – The name of the controller.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, string controller)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.String, System.Object) Generates a fully qualified or absolute URL for an action method by using the specified action name, controller name, and route values.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- controller (System.String) – The name of the controller.
- values (System.Object) – An object that contains route values.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, string controller, object values)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.String, System.Object, System.String) Generates a fully qualified or absolute URL for an action method by using the specified action name, controller name, route values, and protocol to use.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- controller (System.String) – The name of the controller.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, string controller, object values, string protocol)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.String, System.Object, System.String, System.String) Generates a fully qualified or absolute URL for an action method by using the specified action name, controller name, route values, protocol to use, and host name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- controller (System.String) – The name of the controller.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
- host (System.String) – The host name for the URL.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, string controller, object values, string protocol, string host)
-
Action
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.String, System.Object, System.String, System.String, System.String) Generates a fully qualified or absolute URL for an action method by using the specified action name, controller name, route values, protocol to use, host name and fragment.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- action (System.String) – The name of the action method.
- controller (System.String) – The name of the controller.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
- host (System.String) – The host name for the URL.
- fragment (System.String) – The fragment for the URL.
Return type: System.String
Returns: The fully qualified or absolute URL to an action method.
public static string Action(IUrlHelper helper, string action, string controller, object values, string protocol, string host, string fragment)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.Object)¶ Generates a fully qualified or absolute URL for the specified route values.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- values (System.Object) – An object that contains route values.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, object values)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.String) Generates a fully qualified or absolute URL for the specified route name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- routeName (System.String) – The name of the route that is used to generate URL.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, string routeName)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.Object) Generates a fully qualified or absolute URL for the specified route values by using the specified route name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- routeName (System.String) – The name of the route that is used to generate URL.
- values (System.Object) – An object that contains route values.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, string routeName, object values)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.Object, System.String) Generates a fully qualified or absolute URL for the specified route values by using the specified route name, and protocol to use.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- routeName (System.String) – The name of the route that is used to generate URL.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, string routeName, object values, string protocol)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.Object, System.String, System.String) Generates a fully qualified or absolute URL for the specified route values by using the specified route name, protocol to use, and host name.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- routeName (System.String) – The name of the route that is used to generate URL.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
- host (System.String) – The host name for the URL.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, string routeName, object values, string protocol, string host)
-
RouteUrl
(Microsoft.AspNet.Mvc.IUrlHelper, System.String, System.Object, System.String, System.String, System.String) Generates a fully qualified or absolute URL for the specified route values by using the specified route name, protocol to use, host name and fragment.
Arguments: - helper (Microsoft.AspNet.Mvc.IUrlHelper) –
- routeName (System.String) – The name of the route that is used to generate URL.
- values (System.Object) – An object that contains route values.
- protocol (System.String) – The protocol for the URL, such as “http” or “https”.
- host (System.String) – The host name for the URL.
- fragment (System.String) – The fragment for the URL.
Return type: System.String
Returns: The fully qualified or absolute URL.
public static string RouteUrl(IUrlHelper helper, string routeName, object values, string protocol, string host, string fragment)
-