Trying to present the contents of a rich text editor in asp.net mvc and get the "potentially dangerous Request.Form value",

I use TinyMCE in asp.net mvc and get the error message “a potentially dangerous Request.Form value was detected” when I try to save text from the TinyMCE editor. I set ValidateRequest = "false" both in web.config and on the page. Any ideas?

+5
source share
2 answers

Just add the ValidateInput attribute to your action and set it to false.

Like this.

[ValidateInput(false)]
public ActionResult Submit(string FormContent)
{

}
+9
source

To get this working in ASP.NET MVC 2.0, I also had to add

<httpRuntime requestValidationMode="2.0" /> 

in

<system.web> 

web.config

+1

All Articles