Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# HttpRequest - Accessing hashtags in url

Unfortunately because of the wide use of the word "hashtag" and "httprequest" i couldn't find any search results that gave me an answer on whether something like this is even possible.

If i have a url like this:

/Orders/Product#12345

The HttpRequest class shows me that the FilePath, RawUrl, and all other members that show the url as

/Orders/Product

It just gets rid of the hashtag, and i can't find a place to view it.

Is there any way for me to be able to see what hashtag is at the end of the URL from the codebehind? I know i could easily make this a QueryString parameter, but i like the way this looks better, so if there's a way to do it, i'd like to find out what it is :)

Thanks in advance!

like image 677
CloudyOne Avatar asked Apr 11 '12 17:04

CloudyOne


1 Answers

It just gets rid of the hashtag, and i can't find a place to view it.

That's because it doesn't get sent to the server. It's not part of the request - it's only relevant on the client side. If you need to do anything clever with it, you'll need to write some Javascript to access it.

like image 167
Jon Skeet Avatar answered Sep 29 '22 23:09

Jon Skeet