出现:从客户端(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 >  

行了。

posted on 2016-10-17 15:19  枫叶飘零黄昏血  阅读(328)  评论(0编辑  收藏  举报