用Request.QueryString["id"].ToString() 如何不能获取汉字
用Request.QueryString[id].ToString() 怎么不能获取汉字?http://localhost:4987/SMS_MY/admin/admin_ed
用Request.QueryString["id"].ToString() 怎么不能获取汉字?
http://localhost:4987/SMS_MY/admin/admin_edit.aspx?id=周3第3至5节210
显示为:
??3??3??5??210
怎么解决 ?
[最优解释]
http://localhost:4987/SMS_MY/admin/admin_edit.aspx?id=<%Server.UrlEncode("")%>
Server.UrlDecode(Request.QueryString["id"].ToString())
[其他解释]
在页面参数传递时,要进行URL编码和解码
string args = Server.UrlEncode("周3第3至5节210");
ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>setTimeout(function(){location.href='admin_edit.aspx?id?id=" + args + "'},1000); </script>");
接收页面
string info = Server.UrlDecode(Request.QueryString["id"].ToString().Trim());
[其他解释]
显示为:□□3□□3□□5□□210
[其他解释]
改为utf8或者gb2312试试
应该可以的
[其他解释]
+1
[其他解释]utf8编码
Server.UrlEncode
Server.UrlDecode编码解码
[其他解释]传参数的时候应该对值
url编码
[其他解释]传参数的时候把汉字转换为字母
接收的时候在把字母转换为汉字
如果有加密解密方法就更好了。。
用
Server.UrlEncode
Server.UrlDecode
或者网上找个加密解密的吧。。很多。
[其他解释]+++
[其他解释]用这个试一试
[其他解释][其他解释]最常用的方法,当然自己能写个加密和解密的方法更好
[其他解释]Server.UrlEncode
Server.UrlDecode
先编码, 后解码
[其他解释]Server.UrlEncode
Server.UrlDecode
[其他解释]utf8编码
Server.UrlEncode
Server.UrlDecode编码解码
[其他解释]中文参数一般用Server.UrlEncode()进行编码,在取值的时候用Server.UrlDecode()解码
[其他解释]id=<%=Server.UrlEncode("")%>
------其他解决方案--------------------
+
先编码.获取之后再解码.就OK了
[其他解释]在asp:datagrid 链接传送ID 如何写呢?原来是:DataNavigateUrlFormatString="../Search/LxSearch.aspx?Keyword={0} {0}是获得ID ,格式如何写?