A potentially dangerous Request.Form value was detected from the client
2013-12-09 14:58
435 查看
用户在页面上提交表单到服务器时,服务器会检测到一些潜在的输入风险,例如使用富文本编辑器控件(RichTextBox、FreeTextBox、CuteEditor等)编辑的内容中包含有HTML标记或脚本标记,ASP.NET页面会抛出一个"A
potentially dangerous Request.Form value was deceted from the client"的异常。这个是ASP.NET页面为了防范页面注入功能的一种保护机制,要取消这种保护,常规的做法是在.aspx文件的<%@Page %>部分加入ValidateRequest="false"属性。但是从.NET 4.0开始你可能需要多修改一个地方,在网站的web.config文件中加入这行配置:
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
同时,你还需要确保页面上用户输入的部分不会存在任何注入攻击的代码,常用的做法是使用Encode处理。
potentially dangerous Request.Form value was deceted from the client"的异常。这个是ASP.NET页面为了防范页面注入功能的一种保护机制,要取消这种保护,常规的做法是在.aspx文件的<%@Page %>部分加入ValidateRequest="false"属性。但是从.NET 4.0开始你可能需要多修改一个地方,在网站的web.config文件中加入这行配置:
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
同时,你还需要确保页面上用户输入的部分不会存在任何注入攻击的代码,常用的做法是使用Encode处理。
相关文章推荐
- A potentially dangerous Request.Form value was detected from the client
- [TroubleShooting] A potentially dangerous Request.Form value was detected from the client
- 转(A potentially dangerous Request.Form value was detected from the client)
- .net 4.0 A potentially dangerous Request.Form value was detected from the client 的解决方案
- 解决.Net 4.0 A potentially dangerous Request.Form value was detected from the client 异常
- A potentially dangerous Request.Form value was detected from the client 的处理
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client问题处理
- a potentially dangerous request.form value was detected from the client
- MVC 请求参数中带有HTML会引发Validation异常 ("A potentially dangerous Request.Form value was detected from the client")
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client (txtTest="").
- 处理asp.net出现A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- A potentially dangerous Request.Form value was detected from the client
- 解决A potentially dangerous Request.Form value was detected from the client