UrlHelper UrlHelper UrlHelper Class

Definition

Contains methods to build URLs for ASP.NET MVC within an application.

public class UrlHelper
type UrlHelper = class
Public Class UrlHelper
Inheritance
UrlHelperUrlHelperUrlHelper

Constructors

UrlHelper() UrlHelper() UrlHelper()

Initializes a new instance of the UrlHelper class.

UrlHelper(RequestContext) UrlHelper(RequestContext) UrlHelper(RequestContext)

Initializes a new instance of the UrlHelper class using the specified request context.

UrlHelper(RequestContext, RouteCollection) UrlHelper(RequestContext, RouteCollection) UrlHelper(RequestContext, RouteCollection)

Initializes a new instance of the UrlHelper class using the specified request context and route collection.

Properties

RequestContext RequestContext RequestContext

Gets information about an HTTP request that matches a defined route.

RouteCollection RouteCollection RouteCollection

Gets a collection that contains the routes that are registered for the application.

Methods

Action() Action() Action()

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

Action(String) Action(String) Action(String)

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

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

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

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

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

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

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

Action(String, String, Object) Action(String, String, Object) 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) Action(String, String, RouteValueDictionary) 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) Action(String, String, Object, String) 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) Action(String, String, RouteValueDictionary, String) 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) Action(String, String, RouteValueDictionary, String, String) 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.

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

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

Encode(String) Encode(String) Encode(String)

Encodes special characters in a URL string into character-entity equivalents.

GenerateContentUrl(String, HttpContextBase) GenerateContentUrl(String, HttpContextBase) GenerateContentUrl(String, HttpContextBase)

Returns a string that contains a content URL.

GenerateUrl(String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean) GenerateUrl(String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean) GenerateUrl(String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean)

Returns a string that contains a URL.

GenerateUrl(String, String, String, String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean) GenerateUrl(String, String, String, String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean) GenerateUrl(String, String, String, String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean)

Returns a string that contains a URL.

HttpRouteUrl(String, Object) HttpRouteUrl(String, Object) HttpRouteUrl(String, Object)

Generates a fully qualified URL for the specified route values.

HttpRouteUrl(String, RouteValueDictionary) HttpRouteUrl(String, RouteValueDictionary) HttpRouteUrl(String, RouteValueDictionary)

Generates a fully qualified URL for the specified route values.

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

Returns a value that indicates whether the URL is local.

RouteUrl(Object) RouteUrl(Object) RouteUrl(Object)

Generates a fully qualified URL for the specified route values.

RouteUrl(String) RouteUrl(String) RouteUrl(String)

Generates a fully qualified URL for the specified route name.

RouteUrl(RouteValueDictionary) RouteUrl(RouteValueDictionary) RouteUrl(RouteValueDictionary)

Generates a fully qualified URL for the specified route values.

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

Generates a fully qualified URL for the specified route values by using a route name.

RouteUrl(String, RouteValueDictionary) RouteUrl(String, RouteValueDictionary) RouteUrl(String, RouteValueDictionary)

Generates a fully qualified URL for the specified route values by using a route name.

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

Generates a fully qualified URL for the specified route values by using a route name and the protocol to use.

RouteUrl(String, RouteValueDictionary, String, String) RouteUrl(String, RouteValueDictionary, String, String) RouteUrl(String, RouteValueDictionary, String, String)

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

Applies to