很简单的一个ajax提交,却怎么都不成功

$.ajax({
          type: "POST",
          url: "/mms/riskmanage/commitreply",
          data: {
               ID: params.ID ,
               content: data
          },
          error: function (request) {
               alert("Connection error");
          },
          success: function (data, textStatus) {
               alert(data);
          }
});

控制台提示/mms/riskmanage/commitreply这个action找不到

百思不得其解,在浏览器中输入这个action,结果报了一个错

从客户端(&)中检测到有潜在危险的 Request.Path 值

恍然大悟,UEditor提交的是html代码,服务器认为有可能是恶意脚本因此不允许提交

解决办法是在action上添加特性即可

 [HttpPost]
 [ValidateInput(false)]
public ActionResult CommitReply(string content , string ID)
{
   //some codes
}

 

相关文章:

  • 2021-09-02
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2022-01-21
  • 2021-11-22
  • 2021-06-14
猜你喜欢
  • 2022-12-23
  • 2021-10-06
  • 2021-08-19
  • 2021-08-06
  • 2022-01-25
  • 2021-05-25
相关资源
相似解决方案