Tag Archives: .Net 4

ASP.Net

ASP.NET 4.0 potentially dangerous Request.Form value was detected

This was because .NET detected something in the entered text which looked like an HTML statement.
This is a feature put in place to protect your application cross site scripting attack and followed accordingly.

To disable request validation, I added the following to the existing “page” directive in that .aspx file.

ValidateRequest="false"

For .NET 4, we need to add requestValidationMode=”2.0″ to the httpRuntime configuration section of the web.config file like the following:

<httpRuntime requestValidationMode="2.0"/>

But if there is no httpRuntime section in the web.config file, then this goes inside the <system.web> section.

If anyone wants to turn off request validation for globally user, the following line in the web.config file within <system.web> section:

&lt;pages validateRequest=&quot;false&quot; /&gt;