Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 769
user2560521 Avatar asked Mar 09 '26 16:03

user2560521


1 Answers

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.

like image 145
Henry Troup Avatar answered Mar 12 '26 07:03

Henry Troup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!