I use Request.QueryString["var"] to pull the value of http://test.com/test.aspx?var=test into a string
the same thing doesn't work for test.aspx#var=test
how can I get it f开发者_如何学编程rom that version of a querystring?
The Fragment Identifier (#) is client-side only, you can't get that from server side code.
#var=test
is not q query string. That's part of the "URL Fragment". In a URL to a web page, it indicates which <a>
tag to go to.
I don't think the part of the url after the # is passed to the web server directly. To access it you would need to do some javascript processing to pass it on.
精彩评论