您的位置:首页 > 编程语言 > ASP

解决ASP.NET 4.0 "A potentially dangerous Request.Form value was detected from the client". 错误

2012-07-28 15:15 585 查看
在.net中,Request时出现有HTML或Javascript等字符串时,系统会认为是危险性值。立马报错。

(在.aspx文件头中加入这句: <%@ Page validateRequest="false" %>,但还是出现相同错误)

或是修改web.config文件:

<configuration>

< system.web>

<pages validateRequest="false" />

< /system.web>

< /configuration>

但错误依旧。

对.NET 4.0, 应该加上requestValidationMode="2.0" to the httpRuntime configuration section of the web.config :

<httpRuntime requestValidationMode="2.0"/>

结构:<configuration>

<system.web>

<httpRuntime requestValidationMode="2.0">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐