user1118064
user1118064

Reputation: 117

Can Set RequestValidationMode="2.0" page level?

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

Answers (2)

Arjun Shetty
Arjun Shetty

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

Ashwini Verma
Ashwini Verma

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

Related Questions