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

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

险性值。立马报错。

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

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

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

如果还是不行的话

<httpRuntime  requestValidationMode="2.0" />

posted @ 2011-07-13 11:00  Jake.Xu  阅读(...)  评论(... 编辑 收藏