[英]ASP.NET 4 WebForms Routing - Get Physical Page handling the request
Let's assume you have the following PageRoute
我们假设您有以下
PageRoute
routes.MapPageRoute("support", "support", "~/Support.aspx");
Is is possible by the following url: http://www.domain.com/support
to understand which is the physical page handling the request? 可以通过以下URL:
http://www.domain.com/support
: http://www.domain.com/support
了解哪个是处理请求的物理页面? ( support.aspx
) (
support.aspx
)
Request.Url.LocalPath.ToString()
在请求此路由时返回“/Support.aspx” 。
Not sure what you mean by 'understand which is the physical page'. 不确定你是什么意思'了解哪个是物理页面'。 However, you can get the the page URL by:
但是,您可以通过以下方式获取页面URL:
Page.GetRouteUrl("support", null);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.