开发者

asp.net 4 url routing, how to access the route?

I'm using ASP.Net 4 URL routing on a web forms site.

I have multiple routes to a single page

routes.MapPageRoute("","开发者_如何学Cour-services", "~/Information.aspx"); routes.MapPageRoute("","our-company", "~/Information.aspx");

On the destination page (Information.aspx) how can I tell which route was used to get there, for example was it from our-services or our-company?


You can try with

HttpRequest.RawUrl

it should contain the original URL that was called (i.e. before the rewriting)


From the information page, you could check who referred to it via Request.UrlReferrer.

HTH.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜