开发者

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

开发者 https://www.devze.com 2023-02-16 18:28 出处:网络
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\");

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

精彩评论

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