HttpRequestValidationException after upgrading to .NET 4.0

The new .NET 4.0 changes the way that the page validation occurs. It puts in validation in more places now which can cause some issues.

<httpRuntime  requestValidationMode="2.0" />

If you want to revert back to the old validation, just make the following change to your web.config.

Make sure you set the validateRequest = false on the page or in the Pages element.

You can check out what Microsoft has to say here.

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *