Oct 24 2003

A potentially dangerous Request.Form value was detected from the client

Posted by admin under ASP.NET articles

This was added in .NET framework 1.1 and basically it means that you can't post values containing HTML ( or script ) tags to the server.

In other words - if you have a textbox and the visitor enters something like



<a href="http://games.aspcode.net">Play games!</a> 


and then presses Submit button this error will occur since the posted value(s) contains HTML tags.

I won't go into why, just tell you it's for security reasons. You can read more at ASP.Net site. At that site you also get some solutions, and I have read on the web that many people suggests changing web.config. That's a bad solution since it will affect all pages on your site.

Instead add a tag validateRequest="false" into the Page-directive on top of the page you want users to be able to input HTML and script tags.