A potentially dangerous Request.Form value was detected from the client - ASP.NET MVC

后端 未结 5 692
傲寒
傲寒 2020-12-06 04:03

I am getting this error in my ASP.NET MVC application where I am taking HTML input from a WYSIWYG so I don\'t want the content validated.

I have attempted the soluti

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 04:37

    In MVC you would use the ValidateInput(false) attribute.

    You then need to sanitize your inputs, e.g. with something like this (built in to ASP.NET 4.5+; use NuGet package for earlier).

提交回复
热议问题