Saturday, March 13, 2010

ValidateRequest in ASP.NET 4

When switching to ASP.NET 4 I found that my existing ValidateRequest="false" settings were not working, and thus when I submitted HTML in the content of a textbox I would get ASP.NET errors.

In order for ValidateRequest to work in ASP.NET 4 you need to add this to your web.config file.

<system.web>
    <httpRuntime requestValidationMode="2.0" />
</system.web>


This will get things working back to normal.

0 comments: