Class UrlHelper
Represents a factory for creating URLs.
public class UrlHelper
- Inheritance
-
UrlHelper
- Inherited Members
Constructors
UrlHelper()
Initializes a new instance of the UrlHelper class.
public UrlHelper()
UrlHelper(HttpRequestMessage)
Initializes a new instance of the UrlHelper class.
public UrlHelper(HttpRequestMessage request)
Parameters
request
HttpRequestMessageThe HTTP request for this instance.
Properties
Request
Gets or sets the HttpRequestMessage of the current UrlHelper instance.
public HttpRequestMessage Request { get; set; }
Property Value
- HttpRequestMessage
The HttpRequestMessage of the current instance.
Methods
Content(string)
Creates an absolute URL using the specified path.
public virtual string Content(string path)
Parameters
path
stringThe URL path, which may be a relative URL, a rooted URL, or a virtual path.
Returns
- string
The generated URL.
Link(string, IDictionary<string, object>)
Returns a link for the specified route.
public virtual string Link(string routeName, IDictionary<string, object> routeValues)
Parameters
routeName
stringThe name of the route.
routeValues
IDictionary<string, object>An object that contains the parameters for a route.
Returns
- string
A link for the specified route.
Link(string, object)
Returns a link for the specified route.
public virtual string Link(string routeName, object routeValues)
Parameters
Returns
- string
A link for the specified route.
Route(string, IDictionary<string, object>)
Returns the route for the UrlHelper.
public virtual string Route(string routeName, IDictionary<string, object> routeValues)
Parameters
routeName
stringThe name of the route.
routeValues
IDictionary<string, object>A list of route values.
Returns
Route(string, object)
Returns the route for the UrlHelper.
public virtual string Route(string routeName, object routeValues)