网站上传到服务器后,当URL参数中有中文字符(如:http://www.abc.com/e_regExplain.aspx?UserName=错误)就会出现:
错误代码: 500 Internal Server Error。The request was rejected by the HTTP filter. Contact the server administrator. (12217)急!!!!!!!!!!!!!!!!!!!!
谢!!!!!!!!!!!!!!!!!!!!
错误代码: 500 Internal Server Error。The request was rejected by the HTTP filter. Contact the server administrator. (12217)急!!!!!!!!!!!!!!!!!!!!
谢!!!!!!!!!!!!!!!!!!!!
http://support.microsoft.com/kb/820129/zh-cn
UserName=错误
经Server.UrlEncode("错误")改为:
UserName=%e9%94%99%e8%af%af
仍然出现同样的错误在本地电脑上试了,不会出错。
用HttpUtility.UrlEncode();
在接收参数的页面用HttpUtility.UrlDecode()解码一下就可以了。
建议,参数传递时,不管不中文还是英文数学的,都应该编码一下。这样对URL信息是一种保护。也是一种安全的选择.