I get an error 'A potentially dangerous Request.Form value was detected from the client ' when I hit submit on my ASP.NET Webform. What can I do?

This error is caused by a newly introduced feature of .NET Framework 1.1, called "Request Validation"  This feature is designed to help prevent script-injection attacks whereby client script code or HTML is unknowingly submitted to a server, stored, and then presented to other users.

To resolve the problem, you can either :

  1. Disable Request Validation in the web.config file
  2. Disable Request Validation in the Page itself by setting attribute validateRequest=false in Page Directive.

<%Page Language =C# validateRequest=false%>

Was this answer helpful?

 Print this Article

Also Read

I get an error "Access denied to 'D:\public_html\xxx\xxx\web.config'. Failed to start monitoring file changes" when I try to open an ASP.net page. What can I do?

This error usually means that the ASPNet user does not have adequate permission to access the...

How did I send email from ASP.net ?

You have to use System.Web.Mail namespace Below is the code snippets : using System.Web.Mail;...

How do I get my ASP.net application to display non-English language


After I configure the custom error setting in the control panel, I still get the generic error page?

Custom error setting is a web server setting that sets your website Error Pages, but you can...

Why can I still access my ASP.NET pages even though I disabled anonymous access to my directory?

After disabling anonymous access in the permission manager in the control panel, ASP.net pages...