ASP.NET - ValidateRequest="false" Not Working on page directive

Asked By dan scan on 23-Jul-12 12:07 PM
We have an internal 4.0 .NET application that needs to send html from Textboxs. 

I have put the validaterequest=false in the pages that need this but it does not seem to work and still throws the bad input message.  Exception: HttpRequestValidationException

My non-prod environment does not have issues but my prod environment does.  Is there a patch that prevents this from working? Maybe some type of security update? 

Yes I know about all the security issues.  But I need this running yesterday. 

In a later version I will handle this input different. 
Peter Bromberg replied to dan scan on 23-Jul-12 01:06 PM
You need to have

 <httpRuntime requestValidationMode="2.0" />

In your web.config also.
dan scan replied to Peter Bromberg on 23-Jul-12 03:20 PM
That was it. 

ValidateRequest="false" in Page Declaration

and

<httpRuntime requestValidationMode="2.0" />

in web.config.

Maybe typeing the whole thing will enable the search engine to find it for someone else