ValidateRequest = "false" and .NET 4

.NET 4 for some reason broke ValidateRequest="false".

Solution - just put <httpRuntime requestValidationMode="2.0" />in your web.config file.

The problem with this solution is that it interrupts support for .NET 2.0!

IIS refuses to accept unknown attributes in web.config. Also I don't like all or nothing.

Is it possible to set requestValidationMode (or in some other way disable request validation) for one page that it needs? Without breaking backward compatibility web.configwith 2.0?

+2
source share
4 answers

, , , , , - , , .

0

, validateRequest = "true" web.config , !

, , ASP.Net2.0.

, - , , .

+1

, . 2.0 4.0. all none.

, , , . "ValidateRequest =" false "

, web.config system.web, . (Http://msdn.microsoft.com/en-us/library/system.web.configuration.pagessection.validaterequest.aspx)

validateRequest , .

  

, . , . , validateRequest "true", , 2.0. , .

So, briefly ... Set validateRequest to true. Like here.   

Then any page directives are valid for this check.

0
source

I just put this in my web.config in system.web node.

<httpRuntime requestValidationMode="2.0" />
-1
source

All Articles