Potentially unsafe Request.Form with ASP MVC

I recently upgraded mine project from one of the MVC beta to the full version.

I am getting a yellow screen of death on one of my entries "Potentially Dangerous Request.Form yada yada".

So I tried editing the validateRequest attributes of the pages which didn't work.

Then I tried to add

[ValidateInput(false)

]

For an offending action, but when I try to build it, it says the attribute doesn't exist.

So what should I do?

+1


a source to share


2 answers


By the way, breaking MVC 2 / ASP.NET 4 means [ValidateInput(false)]

won't work unless you add the following to <system.web>

part of your web.config file:



<httpRuntime requestValidationMode="2.0" />

      

+4


a source


It works on my site.



Can you try a new simple website? I had some other weird behaviors (strongly typed views didn't work) when I converted web pages from Beta to R1. Launching fresh and copying files to the new network always worked in the end.

+1


a source







All Articles