Edit

Share via


RouteBase.GetVirtualPath(RequestContext, RouteValueDictionary) Method

Definition

When overridden in a derived class, checks whether the route matches the specified values, and if so, generates a URL and retrieves information about the route.

public:
 abstract System::Web::Routing::VirtualPathData ^ GetVirtualPath(System::Web::Routing::RequestContext ^ requestContext, System::Web::Routing::RouteValueDictionary ^ values);
public abstract System.Web.Routing.VirtualPathData GetVirtualPath (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteValueDictionary values);
abstract member GetVirtualPath : System.Web.Routing.RequestContext * System.Web.Routing.RouteValueDictionary -> System.Web.Routing.VirtualPathData
Public MustOverride Function GetVirtualPath (requestContext As RequestContext, values As RouteValueDictionary) As VirtualPathData

Parameters

requestContext
RequestContext

An object that encapsulates information about the requested route.

values
RouteValueDictionary

An object that contains the parameters for a route.

Returns

An object that contains the generated URL and information about the route, or null if the route does not match values.

Remarks

To generate a URL, you use the GetVirtualPath method of the RouteCollection class. That method calls the GetVirtualPath method for each route in the collection to determine whether that route matches the values in values and can therefore generate the URL.

Applies to

See also