Partager via


UrlHelper.RouteUrl Method

Include Protected Members
Include Inherited Members

Generates a fully qualified URL.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method RouteUrl(Object) Generates a fully qualified URL for the specified route values.
Public method RouteUrl(String) Generates a fully qualified URL for the specified route name.
Public method RouteUrl(RouteValueDictionary) Generates a fully qualified URL for the specified route values.
Public method RouteUrl(String, Object) Generates a fully qualified URL for the specified route values by using a route name.
Public method RouteUrl(String, RouteValueDictionary) Generates a fully qualified URL for the specified route values by using a route name.
Public method RouteUrl(String, Object, String) Generates a fully qualified URL for the specified route values by using a route name and the protocol to use.
Public method 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.

Top

Remarks

The URL that is returned by this method has a format like the following:

\Home\About

If special characters in the URL must be encoded, use the Encode method. For the previous example, the Encode method returns the following URL:

%2fHome%2fAbout

See Also

Reference

UrlHelper Class

System.Web.Mvc Namespace