user85562
user85562

Reputation: 53

trying to submit rich text editor content in asp.net mvc and getting "potentially dangerous Request.Form value was detected"

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

Upvotes: 5

Views: 2660

Answers (2)

Ross McLoughlin
Ross McLoughlin

Reputation: 31

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

<httpRuntime requestValidationMode="2.0" /> 

to the

<system.web> 

section of my web.config file

Upvotes: 1

Sruly
Sruly

Reputation: 10540

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

Like this.

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

}

Upvotes: 9

Related Questions