开发者

ASP.NET - A potentially dangerous Request.Form value was detected

开发者 https://www.devze.com 2023-01-04 08:31 出处:网络
On a windows 2008 web server, I get the following error wheneve开发者_JAVA技巧r posting a form containing html tags in textboxes:

On a windows 2008 web server, I get the following error wheneve开发者_JAVA技巧r 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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消