Reputation: 1748
I need to parse url that has something after # (hash) sign in my asp.net application. How to do it easily? Thank you,
Upvotes: 0
Views: 3237
Reputation: 11
This is called "hash sign" URI. After client gets PAGE responsed including js, the contents after '#' would be handled by client using responsed js to get "real" URL for redirection. SEE: https://www.w3.org/2001/tag/2011/01/HashInURI-20110115#References
Upvotes: 1
Reputation: 1748
Omg, I meant fragment (after #) part on the server... Though I've looked thrugh and found that it seems to be impossible......
Upvotes: 0
Reputation: 2155
url.Substring(url.IndexOf('#') + 1)
...where "url" is a string containing the url in question
Upvotes: 1
Reputation: 887657
You're looking for the Uri
class:
new Uri(someString).Fragment
Note that the hash is not sent to the server in an HTTP request.
Upvotes: 2