开发者

How to decode special character in Request.QueryString?

开发者 https://www.devze.com 2023-03-30 08:27 出处:网络
I am passing \'© Alt+ 0169\' in my serach fields in query string. When i am getting QueryString in page like Request.QueryString(\"Sear开发者_如何学GochVal\") then value will be : \'© Alt 0169\' .

I am passing '© Alt+ 0169' in my serach fields in query string.

When i am getting QueryString in page like Request.QueryString("Sear开发者_如何学GochVal") then value will be : '© Alt 0169' .

It reomove '+'.

Could u tell me how can i get it..

Thanks Pankaj Pareek


Use System.Web.HttpUtility.UrlEncode() method.

string encode = HttpUtility.UrlEncode("© Alt+ 0169");
Response.Redirect("Page1.aspx?searchVal=" + encode);
0

精彩评论

暂无评论...
验证码 换一张
取 消