I have a querystring parameter that populates another page and the problem happens when the parameter starts with a hashtag #
Ex:
mysitepage/Details?param=#456
Of course this happens because hashtags in url ends the request. The problem is that these are ids from the database and cant be changed. Instead of using a querystring, is there any work around for this that someone can inform me of.
Edit1-
I realized I was encoding the whole url wheere the problem was. Now I am only doing the parameter part, but it seems to be making the parameter static instead of dynamic now:
example :
String.Format("mysite.com?param="+Server.UrlEncode({0}), Eval("param"))
basically it encodes the 0 in curly braces and not the actual evaluated value
You should checkout
HttpUtility.UrlEncode(string)It will encode # to %23& and of course you can decode it back with
UrlDecode()