Validation detected dangerous client input - post from TinyMCE in ASP.NET

后端 未结 5 1264
礼貌的吻别
礼貌的吻别 2021-01-18 08:15

I get this error when I post from TinyMCE in an ASP.NET MVC view.

Error:

Request Validation has detected a potentially dangerous clien

5条回答
  •  感情败类
    2021-01-18 09:16

    Try using the [AllowHtml] attribute in your model.

    class MyModel{
     [AllowHtml]
     public string Content{get;set;}
    }
    

提交回复
热议问题