Ev.
Ev.

Reputation: 7589

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!

Upvotes: 2

Views: 298

Answers (2)

Yona
Yona

Reputation: 9692

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

Upvotes: 4

Pontus Gagge
Pontus Gagge

Reputation: 17258

Perhaps System.Uri.Fragment? Or what is it you don't see?

Upvotes: 2

Related Questions