UrlHelper.RouteUrl Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
RouteUrl(Object) |
Generates a fully qualified URL for the specified route values. |
RouteUrl(String) |
Generates a fully qualified URL for the specified route name. |
RouteUrl(RouteValueDictionary) |
Generates a fully qualified URL for the specified route values. |
RouteUrl(String, Object) |
Generates a fully qualified URL for the specified route values by using a route name. |
RouteUrl(String, RouteValueDictionary) |
Generates a fully qualified URL for the specified route values by using a route name. |
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) |
Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. |
RouteUrl(Object)
Generates a fully qualified URL for the specified route values.
public virtual string RouteUrl (object routeValues);
abstract member RouteUrl : obj -> string
override this.RouteUrl : obj -> string
Public Overridable Function RouteUrl (routeValues As Object) As String
Parameters
- routeValues
- Object
An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
The fully qualified URL.
Applies to
RouteUrl(String)
Generates a fully qualified URL for the specified route name.
public virtual string RouteUrl (string routeName);
abstract member RouteUrl : string -> string
override this.RouteUrl : string -> string
Public Overridable Function RouteUrl (routeName As String) As String
Parameters
- routeName
- String
The name of the route that is used to generate URL.
Returns
The fully qualified URL.
Applies to
RouteUrl(RouteValueDictionary)
Generates a fully qualified URL for the specified route values.
public virtual string RouteUrl (System.Web.Routing.RouteValueDictionary routeValues);
abstract member RouteUrl : System.Web.Routing.RouteValueDictionary -> string
override this.RouteUrl : System.Web.Routing.RouteValueDictionary -> string
Public Overridable Function RouteUrl (routeValues As RouteValueDictionary) As String
Parameters
- routeValues
- RouteValueDictionary
An object that contains the parameters for a route.
Returns
The fully qualified URL.
Applies to
RouteUrl(String, Object)
Generates a fully qualified URL for the specified route values by using a route name.
public virtual string RouteUrl (string routeName, object routeValues);
abstract member RouteUrl : string * obj -> string
override this.RouteUrl : string * obj -> string
Public Overridable Function RouteUrl (routeName As String, routeValues As Object) As String
Parameters
- routeName
- String
The name of the route that is used to generate URL.
- routeValues
- Object
An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
Returns
The fully qualified URL.
Applies to
RouteUrl(String, RouteValueDictionary)
Generates a fully qualified URL for the specified route values by using a route name.
public virtual string RouteUrl (string routeName, System.Web.Routing.RouteValueDictionary routeValues);
abstract member RouteUrl : string * System.Web.Routing.RouteValueDictionary -> string
override this.RouteUrl : string * System.Web.Routing.RouteValueDictionary -> string
Public Overridable Function RouteUrl (routeName As String, routeValues As RouteValueDictionary) As String
Parameters
- routeName
- String
The name of the route that is used to generate URL.
- routeValues
- RouteValueDictionary
An object that contains the parameters for a route.
Returns
The fully qualified URL.
Applies to
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 virtual string RouteUrl (string routeName, object routeValues, string protocol);
abstract member RouteUrl : string * obj * string -> string
override this.RouteUrl : string * obj * string -> string
Public Overridable Function RouteUrl (routeName As String, routeValues As Object, protocol As String) As String
Parameters
- routeName
- String
The name of the route that is used to generate the URL.
- routeValues
- Object
An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.
- protocol
- String
The protocol for the URL, such as "http" or "https".
Returns
The fully qualified URL.
Applies to
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.
public virtual string RouteUrl (string routeName, System.Web.Routing.RouteValueDictionary routeValues, string protocol, string hostName);
abstract member RouteUrl : string * System.Web.Routing.RouteValueDictionary * string * string -> string
override this.RouteUrl : string * System.Web.Routing.RouteValueDictionary * string * string -> string
Public Overridable Function RouteUrl (routeName As String, routeValues As RouteValueDictionary, protocol As String, hostName As String) As String
Parameters
- routeName
- String
The name of the route that is used to generate URL.
- routeValues
- RouteValueDictionary
An object that contains the parameters for a route.
- protocol
- String
The protocol for the URL, such as "http" or "https".
- hostName
- String
The host name for the URL.
Returns
The fully qualified URL.