System.Web.HttpRequestValidationException (0x80004005): A potentially dangerous Request.QueryString value was detected..
Posted on 2012-03-16 16:48 zqwuwei 阅读(1681) 评论(0) 编辑 收藏 举报You may get "A potentially dangerous Request.QueryString value was detected from the client" after upgrading to ASP.NET 4
The mentioned exception is happening because in ASP.NET 4, the request validation is now being called for every asp.net resource like web services and other httphandlers.As a result, you may get that exception even if you turned off the RequestValidation via: <pages validateRequest="false" .... section. This is one of the breaking changes that were mentioned here. So the solution is to set the new HttpRuntime "RequestValidationMode" property to "2.0" and it should take care of that exception. <httpRuntimerequestValidationMode="2.0" />
|