问题
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