A potentially dangerous Request.Form value was detected from the client

简介:

用户在页面上提交表单到服务器时,服务器会检测到一些潜在的输入风险,例如使用富文本编辑器控件(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处理。


本文转自Jaxu博客园博客,原文链接:http://www.cnblogs.com/jaxu/archive/2013/01/28/2880115.html,如需转载请自行联系原作者

相关文章
|
1月前
|
应用服务中间件 Apache
消息 Request method ‘POST‘ not supported
消息 Request method ‘POST‘ not supported
|
9月前
|
KVM 虚拟化
成功解决Problem while trying to mount target]\“. HTTP response code is 400
成功解决Problem while trying to mount target]\“. HTTP response code is 400
|
9月前
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1052 0
|
应用服务中间件 API nginx
解决跨域问题 Response to preflight request doesn't pass access control check
解决跨域问题 Response to preflight request doesn't pass access control check
9099 0
|
SQL 关系型数据库 MySQL
【解决思路】HTTP Status 500 Type Exception ReportMessage Request processing failed; 【已解决】
经常测试的一个网页,突然报错500。前面也没有发生过,但突然报错,只能先改错了,不然都没法进入页面。为什么会调用到存在bug的语句,而以前没有发生这种情况?这一问题没能想清楚,只能归咎于编译器了。
298 0
【解决思路】HTTP Status 500 Type Exception ReportMessage Request processing failed; 【已解决】
|
应用服务中间件
returned a response status of 405 Method Not Allowed
returned a response status of 405 Method Not Allowed
returned a response status of 405 Method Not Allowed
|
开发工具 git
解决:The requested URL returned error: 403
今天在 arm 架构的服务器上创建工程时,遇到了一个报错,执行的命令如下: git clone git.liuzhen007.com/boffmpeg.gi… 报错信息如下: fatal: unable to access 'git.liuzhen007.com/boffmpeg.gi…': The requested URL returned error: 403
2243 0
GM6 PageSet request didn&#39;t have target application url
GM6 PageSet request didn&#39;t have target application url
131 0
GM6 PageSet request didn&#39;t have target application url