RouteCollection.GetVirtualPath 方法

定義

傳回與該路由關聯之 URL 路徑的相關資訊。Returns information about the URL path that is associated with the route.

多載

GetVirtualPath(RequestContext, RouteValueDictionary)

依據指定的內容與參數值,傳回與該路由關聯的 URL 路徑相關資訊。Returns information about the URL path that is associated with the route, given the specified context and parameter values.

GetVirtualPath(RequestContext, String, RouteValueDictionary)

依據指定的內容、路由名稱與參數值,傳回與該具名路由關聯的 URL 路徑相關資訊。Returns information about the URL path that is associated with the named route, given the specified context, route name, and parameter values.

GetVirtualPath(RequestContext, RouteValueDictionary)

依據指定的內容與參數值,傳回與該路由關聯的 URL 路徑相關資訊。Returns information about the URL path that is associated with the route, given the specified context and parameter values.

public:
 System::Web::Routing::VirtualPathData ^ GetVirtualPath(System::Web::Routing::RequestContext ^ requestContext, System::Web::Routing::RouteValueDictionary ^ values);
public System.Web.Routing.VirtualPathData GetVirtualPath (System.Web.Routing.RequestContext requestContext, System.Web.Routing.RouteValueDictionary values);
member this.GetVirtualPath : System.Web.Routing.RequestContext * System.Web.Routing.RouteValueDictionary -> System.Web.Routing.VirtualPathData

參數

requestContext
RequestContext

封裝要求路徑相關資訊的物件。An object that encapsulates information about the requested route.

values
RouteValueDictionary

包含路徑參數的物件。An object that contains the parameters for a route.

傳回

包含與該路由關聯之 URL 路徑資訊的物件。An object that contains information about the URL path that is associated with the route.

另請參閱

GetVirtualPath(RequestContext, String, RouteValueDictionary)

依據指定的內容、路由名稱與參數值,傳回與該具名路由關聯的 URL 路徑相關資訊。Returns information about the URL path that is associated with the named route, given the specified context, route name, and parameter values.

public:
 System::Web::Routing::VirtualPathData ^ GetVirtualPath(System::Web::Routing::RequestContext ^ requestContext, System::String ^ name, System::Web::Routing::RouteValueDictionary ^ values);
public System.Web.Routing.VirtualPathData GetVirtualPath (System.Web.Routing.RequestContext requestContext, string name, System.Web.Routing.RouteValueDictionary values);
member this.GetVirtualPath : System.Web.Routing.RequestContext * string * System.Web.Routing.RouteValueDictionary -> System.Web.Routing.VirtualPathData

參數

requestContext
RequestContext

封裝要求路徑相關資訊的物件。An object that encapsulates information about the requested route.

name
String

擷取 URL 路徑相關資訊時使用的路由名稱。The name of the route to use when information about the URL path is retrieved.

values
RouteValueDictionary

包含路徑參數的物件。An object that contains the parameters for a route.

傳回

包含與該路由關聯之 URL 路徑資訊的物件。An object that contains information about the URL path that is associated with the route.

例外狀況

找不到任何含有在 name 參數中指定的名稱的路由。No route could be found that has the name specified in the name parameter.

另請參閱

適用於