Timwi
Timwi

Reputation: 66604

“A potentially dangerous Request.Form value was detected from the client”

How do I disable this page validation entirely and for good in ASP.NET MVC 3?

I have looked through the error message and the other questions with the same title. None of the suggested solutions help:

But I am still getting the error. What else can I try?

Upvotes: 2

Views: 4035

Answers (2)

Timwi
Timwi

Reputation: 66604

Add the following line of code:

GlobalFilters.Filters.Add(new ValidateInputAttribute(false));

to the Application_Start() method.

Upvotes: 5

SLaks
SLaks

Reputation: 888243

Add [AllowHtml] to the action, parameter, or property.

EDIT: If you want to allow it anywhere, add new ValidateInputAttribute(false)] to GlobalFilters.Filters.

Upvotes: 3

Related Questions