Error :- "A potentially dangerous Request.Form value was detected from the client"
To resolve this, we are having following solutions:-
1. Set validateRequest="false" in page directives, e.g.
<%@ Page Language="C#" MasterPageFile="MasterPage.master" ValidateRequest="false" %>
2. Set validateRequest="false" in web.config file, e.g.
<system.web>
<pages validateRequest="false" />
</system.web>
Above given 2 settings will work for ASP.Net 2.0 to 3.5 and 4.5, but not for ASP.Net 4.0
3. Set requestValidationMode="2.0" in web.config if you are using ASP.Net 4.0
<configuration>
<system.web>
<httpRuntime requestValidationMode="2.0" />
</system.web>
</configuration>
0 Comment(s)