"A potentially dangerous Request.Form value was detected the client".

在4.0以前的年代,简单在页面头部标注一个ValidateRequest=’false’或者在web.config里面标识即可,然则4.0下这么批改后是无效的,还须要在web.config文件里面标注<httpRuntime requestValidationMode="2.0"/>

httpRuntime节点若是不存在,那么就添加到<system.web>节点下。

也就是说,<system.web>节点下,有这两个节点就对了:

<system.web>


    <pages validateRequest="false"></pages>


    <httpRuntime requestValidationMode="2.0"></httpRuntime>


</system.web>


Controller Action上增加[ValidateInput(false)] 特性


测试成功

相关文章:

  • 2021-07-23
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2021-11-16
  • 2022-01-23
  • 2021-09-22
  • 2021-07-10
相关资源
相似解决方案