从客户端(Content="<p>666</p>")中检测到有潜在危险的 Request.Form 值。

出现:从客户端(Content="<p>测试</p>")中检测到有潜在危险的 Request.Form 值。

一般是在线编辑器有HTML标签的,我是用的MVC.

所以,首先:在action上加[ValidateInput(false)]标识

[HttpPost]  
[ValidateInput(false)]  
public ActionResult Add(User user)  
{  
return View();  
} 

然后:在httpRuntime  节点上加设置

<system.web >  
<httpRuntime  requestValidationMode="2.0"  maxRequestLength="10240" executionTimeout="60"   />  
</system.web >  

行了。

原文地址:https://www.cnblogs.com/qiywtc/p/5969908.html