Reputation: 117
I am developing a web application based on ASP.NET 4.0 and having some few pages with potential dangerous request(having markup codes).
So instead of setting RequestValidationMode="2.0" in web.config, can I set that property only for those few pages?
Upvotes: 3
Views: 4702
Reputation: 1585
Answer hidden somewhere in msdn, hope this helps you too.. Better late then never Try this,
<location path="test.aspx">
<system.web>
<httpRuntime requestValidationMode="2.0" />
</system.web>
</location>
Reference
http://msdn.microsoft.com/en-us/library/hh882339(v=vs.100).aspx
Upvotes: 8
Reputation: 7525
for avoiding this error: potentially dangerous request.form value was detected from the client.
you can use page level property : <%@ Page ... ValidateRequest="false" %>
Upvotes: 0