首页 > 代码库 > A potentially dangerous Request.Form value was detected from the client问题处理

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页面为了防范页面注入功能的一种保护机制,要取消这种保护,需要在配置文件中加入以下代码。

 

得到解决:

1、Web.config文件增加 以下节点。

<system.web>     <httpRuntime requestValidationMode="2.0" /></system.web>

 

A potentially dangerous Request.Form value was detected from the client问题处理