日期:2014-05-17  浏览次数:20976 次

怎样解决地址栏中文问题?
怎样解决地址栏中文问题?

------解决方案--------------------
Server.URLEncode(字符串)
------解决方案--------------------
<%
a="测试汉字"
%>
<a href="链接.asp?p=<%=server.URLEncode(a)%>">测试汉字</a>
<%
response.Write(request.QueryString("p"))
%>

------解决方案--------------------
+1将字符串转化为所有浏览器都认识的URL编码
探讨

Server.URLEncode(字符串)

------解决方案--------------------
视图层页面使用JS函数 encodeURIComponent(encodeURIComponent('传过来的参数'));

业务逻辑层获取后使用URLEncode(字符串)进行转译。