Saturday, June 18, 2011

I spent over three weeks looking for a solution.. this was driving me crazy.

I had a website developed in ASP.NET 2.0 a few years back and deployed it on a server I paid for (Webhostforasp.net).. All of a sudden about a month back, all text boxes across the pages of my website started throwing this error

"A potentially dangerous Request.Form value was detected from the client (ctl00$cphAdmin$txtContent$TinyMCE1$txtContent="

I tried everything including putting in my web.config file but it did not work till I found the trick I was missing..

Unknown to me my server provider had updated his server to be compatible with ASP.NET 4.0 which had stricter entry rules AND did not recognize pages validateRequest = false statement in web.config... solution is simple

Step 1. Within your web.config file under system.web
< system.web >
< pages validaterequest="false" / >

< /system.web>

Step 2. Within your web.config file under system.web
< system.web >
< httpruntime requestvalidationmode="2.0" / >
< /system.web >


This worked for me and hope it works for you as well...