先替换为其他字符,到需要获取str的页面再替换回去
如str="jkl" k为特殊字符
则str=str.replace("k","n");
window.open('test.aspx?ok='+str);
在需要获取str的页面取到str后再
str=str.replace("n","k");
如str="jkl" k为特殊字符
则str=str.replace("k","n");
window.open('test.aspx?ok='+str);
在需要获取str的页面取到str后再
str=str.replace("n","k");
super.aspx?OK1=XX&OK2=AAA
例如:
this.Response.Rediret("test.aspx?tt="+System.Web.HttpUtility.UrlEncode("aaa++bb"));
在Request["tt"]中得到的就是:"aaa++bb"了。
你试一下,希望对你有帮助。
encodeURIComponent(encodedURIString)
window.open('test.aspx?ok='+encodeURIComponent(str));
================
c#:
string str=Server.UrlDecode(string(Request.QueryString["ok"]));
javascript:
window.open('test.aspx?ok='+encodeURIComponent(str));
================
c#:
string str=Server.UrlDecode((string)Request.QueryString["ok"]);