IUrlHelper IUrlHelper IUrlHelper Interface

Definition

Defines the contract for the helper to build URLs for ASP.NET MVC within an application.

public interface IUrlHelper
type IUrlHelper = interface
Public Interface IUrlHelper
Derived

Properties

ActionContext ActionContext ActionContext

Gets the ActionContext for the current request.

Methods

Action(UrlActionContext) Action(UrlActionContext) Action(UrlActionContext)

Generates a URL with an absolute path for an action method, which contains the action name, controller name, route values, protocol to use, host name, and fragment specified by UrlActionContext. Generates an absolute URL if Protocol and Host are non-null.

Content(String) Content(String) Content(String)

Converts a virtual (relative) path to an application absolute path.

IsLocalUrl(String) IsLocalUrl(String) IsLocalUrl(String)

Returns a value that indicates whether the URL is local. A URL is considered local if it does not have a host / authority part and it has an absolute path. URLs using virtual paths ('~/') are also local.

Link(String, Object) Link(String, Object) Link(String, Object)

Generates an absolute URL for the specified routeName and route values, which contains the protocol (such as "http" or "https") and host name from the current request.

RouteUrl(UrlRouteContext) RouteUrl(UrlRouteContext) RouteUrl(UrlRouteContext)

Generates a URL with an absolute path, which contains the route name, route values, protocol to use, host name, and fragment specified by UrlRouteContext. Generates an absolute URL if Protocol and Host are non-null.

Extension Methods

Action(IUrlHelper) Action(IUrlHelper) Action(IUrlHelper)

Generates a URL with an absolute path for an action method.

Action(IUrlHelper, String) Action(IUrlHelper, String) Action(IUrlHelper, String)

Generates a URL with an absolute path for an action method, which contains the specified action name.

Action(IUrlHelper, String, Object) Action(IUrlHelper, String, Object) Action(IUrlHelper, String, Object)

Generates a URL with an absolute path for an action method, which contains the specified action name and route values.

Action(IUrlHelper, String, String) Action(IUrlHelper, String, String) Action(IUrlHelper, String, String)

Generates a URL with an absolute path for an action method, which contains the specified action and controller names.

Action(IUrlHelper, String, String, Object) Action(IUrlHelper, String, String, Object) Action(IUrlHelper, String, String, Object)

Generates a URL with an absolute path for an action method, which contains the specified action name, controller name, and route values.

Action(IUrlHelper, String, String, Object, String) Action(IUrlHelper, String, String, Object, String) Action(IUrlHelper, String, String, Object, String)

Generates a URL with an absolute path for an action method, which contains the specified action name, controller name, route values, and protocol to use.

Action(IUrlHelper, String, String, Object, String, String) Action(IUrlHelper, String, String, Object, String, String) Action(IUrlHelper, String, String, Object, String, String)

Generates a URL with an absolute path for an action method, which contains the specified action name, controller name, route values, protocol to use, and host name. Generates an absolute URL if the protocol and host are non-null.

Action(IUrlHelper, String, String, Object, String, String, String) Action(IUrlHelper, String, String, Object, String, String, String) Action(IUrlHelper, String, String, Object, String, String, String)

Generates a URL with an absolute path for an action method, which contains the specified action name, controller name, route values, protocol to use, host name, and fragment. Generates an absolute URL if the protocol and host are non-null.

Page(IUrlHelper, String) Page(IUrlHelper, String) Page(IUrlHelper, String)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, Object) Page(IUrlHelper, String, Object) Page(IUrlHelper, String, Object)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, String) Page(IUrlHelper, String, String) Page(IUrlHelper, String, String)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, String, Object) Page(IUrlHelper, String, String, Object) Page(IUrlHelper, String, String, Object)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, String, Object, String) Page(IUrlHelper, String, String, Object, String) Page(IUrlHelper, String, String, Object, String)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, String, Object, String, String) Page(IUrlHelper, String, String, Object, String, String) Page(IUrlHelper, String, String, Object, String, String)

Generates a URL with an absolute path for the specified pageName.

Page(IUrlHelper, String, String, Object, String, String, String) Page(IUrlHelper, String, String, Object, String, String, String) Page(IUrlHelper, String, String, Object, String, String, String)

Generates a URL with an absolute path for the specified pageName.

RouteUrl(IUrlHelper, Object) RouteUrl(IUrlHelper, Object) RouteUrl(IUrlHelper, Object)

Generates a URL with an absolute path for the specified route values.

RouteUrl(IUrlHelper, String) RouteUrl(IUrlHelper, String) RouteUrl(IUrlHelper, String)

Generates a URL with an absolute path for the specified routeName.

RouteUrl(IUrlHelper, String, Object) RouteUrl(IUrlHelper, String, Object) RouteUrl(IUrlHelper, String, Object)

Generates a URL with an absolute path for the specified routeName and route values.

RouteUrl(IUrlHelper, String, Object, String) RouteUrl(IUrlHelper, String, Object, String) RouteUrl(IUrlHelper, String, Object, String)

Generates a URL with an absolute path for the specified route routeName and route values, which contains the specified protocol to use.

RouteUrl(IUrlHelper, String, Object, String, String) RouteUrl(IUrlHelper, String, Object, String, String) RouteUrl(IUrlHelper, String, Object, String, String)

Generates a URL with an absolute path for the specified route routeName and route values, which contains the specified protocol to use and host name. Generates an absolute URL if Protocol and Host are non-null.

RouteUrl(IUrlHelper, String, Object, String, String, String) RouteUrl(IUrlHelper, String, Object, String, String, String) RouteUrl(IUrlHelper, String, Object, String, String, String)

Generates a URL with an absolute path for the specified route routeName and route values, which contains the specified protocol to use, host name and fragment. Generates an absolute URL if Protocol and Host are non-null.

Applies to