I was wondering how to handle special chars in the query string when redirecting the page to a different page with the help of Javascript. I thought of sharing this snippet.
Hope this will help you guys...
Here javascript
escape is used to encode the string and
unescape is to decode the string in Javascript.
var vstr = escape("It's wounderful!")
alert(vstr);
alert(unescape(vstr));
If you wanna handle this at server side use the following code.
string str = Server.UrlDecode(Request.QueryString["trial"]);
or
string str = Server.UrlEncode(Request.QueryString["trial"]);