UrlHelper Class

 

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

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

System.Object
  System.Web.Mvc.UrlHelper

public class UrlHelper

NameDescription
System_CAPS_pubmethodUrlHelper()

Initializes a new instance of the UrlHelper class.

System_CAPS_pubmethodUrlHelper(RequestContext)

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

System_CAPS_pubmethodUrlHelper(RequestContext, RouteCollection)

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

NameDescription
System_CAPS_pubpropertyRequestContext

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

System_CAPS_pubpropertyRouteCollection

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

NameDescription
System_CAPS_pubmethodAction()

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

System_CAPS_pubmethodAction(String)

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

System_CAPS_pubmethodAction(String, Object)

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

System_CAPS_pubmethodAction(String, RouteValueDictionary)

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

System_CAPS_pubmethodAction(String, String)

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

System_CAPS_pubmethodAction(String, String, Object)

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

System_CAPS_pubmethodAction(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.

System_CAPS_pubmethodAction(String, String, RouteValueDictionary)

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

System_CAPS_pubmethodAction(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.

System_CAPS_pubmethodAction(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.

System_CAPS_pubmethodContent(String)

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

System_CAPS_pubmethodEncode(String)

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

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGenerateContentUrl(String, HttpContextBase)

Returns a string that contains a content URL.

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

Returns a string that contains a URL.

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

Returns a string that contains a URL.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodHttpRouteUrl(String, Object)

Generates a fully qualified URL for the specified route values.

System_CAPS_pubmethodHttpRouteUrl(String, RouteValueDictionary)

Generates a fully qualified URL for the specified route values.

System_CAPS_pubmethodIsLocalUrl(String)

Returns a value that indicates whether the URL is local.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodRouteUrl(Object)

Generates a fully qualified URL for the specified route values.

System_CAPS_pubmethodRouteUrl(RouteValueDictionary)

Generates a fully qualified URL for the specified route values.

System_CAPS_pubmethodRouteUrl(String)

Generates a fully qualified URL for the specified route name.

System_CAPS_pubmethodRouteUrl(String, Object)

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

System_CAPS_pubmethodRouteUrl(String, Object, String)

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

System_CAPS_pubmethodRouteUrl(String, RouteValueDictionary)

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

System_CAPS_pubmethodRouteUrl(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.

System_CAPS_pubmethodToString()

(Inherited from Object.)

The UrlHelper class provides the following methods to help you work with URLs:

  • Action. This method generates a URL that maps to an action method.

  • RouteUrl. This method generates a URL that maps to a route.

  • Content. This method generates a URL path to a resource, based on the virtual (relative) path of the resource.

  • Encode. This method encodes special characters in the specified URL into character-entity equivalents.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: