Vistance
Vistance

Reputation: 345

Receiving "potentially dangerous Request.Form" with requestValidationMode = 2.0

I'm trying to pass raw HTML using ViewBag and Html.Raw, I have another instance of logic identical to this that works in my app but when I duplicated it on another page I'm getting this error again.

I have already enabled <httpRuntime requestValidationMode="2.0" /> in my config file. Why am I still getting this message? Shouldn't this allow it across the entire application?

Upvotes: 0

Views: 39

Answers (1)

Ram
Ram

Reputation: 330

Give [ValidateInput(false)] in your method.

Upvotes: 1

Related Questions