MVC ashx 中禁用Html标签请求验证

在页面异步请求处理文件ashx,要提交内容中包含html标签

提交时出错!

解决办法:

1. <system.web>

<httpRuntime requestValidationMode="2.0" />
    </system.web> web.config下配置这个节点

2.ActionResult 加上[ValidateInput(false)]

如:

[ValidateInput(false)]

public ActionResult Index()

{

  return View();

}

问题解决!!!!

posted @ 2011-10-27 12:02  orenal  阅读(391)  评论(0编辑  收藏  举报