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

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

由于在.net中,Request时出现有HTML或Javascript等字符串时,系统会认为是危

险性值。立马报错。

解决方案一:
在.aspx文件头中加入这句:
<%@ Page validateRequest="false"  %>

解决方案二:
修改web.config文件:
<configuration>
  <system.web>
    <pages validateRequest="false" />
  </system.web>
</configuration>

因为validateRequest默认值为true。只要设为false即可。