Supreet
Supreet

Reputation: 2531

Potentially dangerous Request.Form value was detected

i am using mce editor in a user control and added ValidateRequest="false" in page directive on which i have used that control then also I am getting "A potentially dangerous Request.Form value was detected" error. How to solve this?

Upvotes: 1

Views: 139

Answers (2)

DSharper
DSharper

Reputation: 3217

If you are using .NET 4 you may need to change your web config too.

<httpRuntime requestValidationMode="2.0" /> in web.config.

When you change page like validateRequest="false" make sure you are HTML encoding strings.

Upvotes: 1

Freeman
Freeman

Reputation: 5801

In order for the ValidateRequest="false" attribute to be applied, you must add the following entry

<httpRuntime requestValidationMode="2.0" /> 

to your web.config.

Upvotes: 1

Related Questions