{"id":1408,"date":"2012-07-06T14:39:33","date_gmt":"2012-07-06T14:39:33","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=1408"},"modified":"2012-07-06T14:39:33","modified_gmt":"2012-07-06T14:39:33","slug":"asp-net-4-0-potentially-dangerous-request-form-value-was-detected","status":"publish","type":"post","link":"https:\/\/galhano.com\/blog\/?p=1408","title":{"rendered":"ASP.NET 4.0 potentially dangerous Request.Form value was detected"},"content":{"rendered":"<p>This was because .NET detected something in the entered text which looked like an HTML statement.<br \/>\nThis is a feature put in place to protect your application cross site scripting attack and followed accordingly.<\/p>\n<p>To disable request validation, I added the following to the existing &#8220;page&#8221; directive in that .aspx file.<br \/>\n[xml]ValidateRequest=&quot;false&quot;[\/xml]<\/p>\n<p>For .NET 4, we need to add requestValidationMode=&#8221;2.0&#8243; to the httpRuntime configuration section of the web.config file like the following:<\/p>\n<p>[xml]&lt;httpRuntime requestValidationMode=&quot;2.0&quot;\/&gt;[\/xml]<\/p>\n<p>But if there is no httpRuntime section in the web.config file, then this goes inside the &lt;system.web&gt; section.<\/p>\n<p>If anyone wants to turn off request validation for globally user, the following line in the web.config file within &lt;system.web&gt; section:<\/p>\n<p>[xml]&lt;pages validateRequest=&quot;false&quot; \/&gt; [\/xml]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This was because .NET detected something in the entered text which looked like an HTML statement. This is a feature put in place to protect your application cross site scripting attack and followed accordingly. To disable request validation, I added the following to the existing &#8220;page&#8221; directive in that .aspx file. [xml]ValidateRequest=&quot;false&quot;[\/xml] For .NET 4, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[145,170],"class_list":["post-1408","post","type-post","status-publish","format-standard","hentry","category-aspnet","tag-net-4","tag-aspnet","author-admin"],"_links":{"self":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1408"}],"version-history":[{"count":2,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1408\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1408\/revisions\/1410"}],"wp:attachment":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}