user2560521
user2560521

Reputation: 476

cant use requestvalidationmode in framework 3.5

First I got an exception : System.Web.HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value.... from searching the web I found that adding to my web.config :

<system.web>
   <httpRuntime requestValidationMode="2.0" />
</system.web>

should solve the problem, but I get an error : requestValidationMode is not allowed. I am using framework 3.5, maybe thats the reason... can someone help ?

Upvotes: 3

Views: 946

Answers (1)

Henry Troup
Henry Troup

Reputation: 180

In 3.5, you don't need the requestvalidationmode. To suppress asp.net validation on postback, just set the @Page parameter validaterequest="false" in the .aspx.

You need this if, for example, you are handling submitted HTML. You also then need to sanitize your input carefully.

Upvotes: 1

Related Questions