Retrieving Anchor Link In URL for ASP.Net

前端 未结 3 1710
滥情空心
滥情空心 2020-11-27 22:28

I have an url like so:

http://localhost/place/663828/bangkok-paradise-restaurant-toronto#r306040

I am trying to see if theres the existence of the anchor tag

3条回答
  •  一向
    一向 (楼主)
    2020-11-27 22:35

    Being more explicit, the anchor tag is never sent as part of the HTTP request by any browser, it is only interpreted locally within the browser. Neither ASP.NET nor any other web-server technology, Microsoft or otherwise will see the anchor on that request.

    RFC 1808
    Section 2.4.1 - "Note that the fragment identifier is not considered part of the URL."

    As others have suggested the nearest you could get would be using client-side to read browser window location.

提交回复
热议问题