ASP.NET 4 WebForms Routing - Get Physical Page handling the request

Deadly 提交于 2019-12-12 14:27:56

问题


Let's assume you have the following 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? (support.aspx)


回答1:


Not sure what you mean by 'understand which is the physical page'. However, you can get the the page URL by:

Page.GetRouteUrl("support", null);



回答2:


Request.Url.LocalPath.ToString() returns "/Support.aspx" when this route is being requested.



来源:https://stackoverflow.com/questions/8973589/asp-net-4-webforms-routing-get-physical-page-handling-the-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!