错误解决:A potentially dangerous Request.Form value was detected from the client
在网站后台插入数据,返回下面的错误:系统检测到有潜在危险的 Request.Form 值。
A potentially dangerous Request.Form value was detected from the client (txtTest="<b>").
.net 4之前,它只在aspx文件及类文件被调用的时候,才会起作用!
.net 4之后,它会对所有的http请求起作用,即使用了ValidateRequest=False
要解决验证错误,只能继续使用.net 2.0的请求验证功能:
即在web.config文件中的<system.web>标签中加入下面的代码。
<httpRuntime requestValidationMode="2.0"/>