httpurluri-fragment

Accessing Jump Links (the part of the URL after a hasch character, #) from the code behind


Anyone know if it's possible to access the name of a jump link in c# code?

I'm doing some url Rewriting stuff and I'm thinking I might not be able to see that part of the URL.

So basically, my URL looks a little something like this:

http://www.mysite.com/Terms.aspx#Term1

And I want to access "Term1". I can't see it in the ServerVariables...

Any ideas?!?!?

THANKS!


Solution

  • The hash character is meant for client side navigation. Anything after the # is not submitted to the server.

    From the wikipedia article:

    The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the server. When an agent (such as a Web browser) requests a resource from a Web server, the agent sends the URI to the server, but does not send the fragment.

    Its technical name is Fragment Identifier