The Hash Sign (#) represents another portal of the URL (
http://www.w3schools.com/jsref/prop_loc_hash.asp).
If you still need to include the # sign in query string and try the following code while retrieving the query string
window.location.search + window.location.hash
Or Try to use HTMLEncode/Decode
Happy Coding....