Q:

If URL contain "#", How do I get the full url of the page in C#?

I need to be able to get at the full URL of the page
The page url is like this
http://localhost:12365/Dashboard.aspx#access_token=adfgafdg73e9c4ggg186fbfcf05e775a6f2gggd8&expires_in=3600&token_type=Bearer&state=zxv

In this URL, after # how to get the access_token value?

A:

You cannot. Anything in the fragment (the portion from the # onwards) is not sent to the server. Only the client can look at that, which you can do in javascript via window.location.hash.
One useful trick that some sites use, is to use the fragment to prevent user data appearing in http request logs; the page might be /foo/bar#something, which loads /foo/bar, then client-side javascript looks at the fragment and does an ajax POST to get data to load the content. This works because most http logs record the GET uri but not POST form bodies, so the #something isn't captured in the logs.

