4
votes

On a windows 2008 web server, I get the following error whenever posting a form containing html tags in textboxes:

A potentially dangerous Request.Form value was detected from the client (widget$txtText="

This is a common error and you fix it by either doing Page ValidateRequest = false or in the web.config with pages validaterequest = false. However, on this specific server, it completely ignores the validaterequest = false and throws this exception anyway. Has anyone seen this behavior before and know what else I can do to prevent this error? I've seen it in 2 web apps now on the same server, it's really weird.

Thanks, Justin

2

2 Answers

2
votes

I don;t know about 3.5 but to fix it in 4.0 use

<httpRuntime requestValidationMode="2.0" />

in your web.config and set the page directive as you said in your question.

0
votes

What version of .NET are you running? Page validation works a little differently in .NET 4.