ValidateRequest =“假”和.NET 4问题 [英] ValidateRequest=“false” and .NET 4 problem
问题描述
.NET 4打破了 ValidateRequest =FALSE
出于某种原因。
.NET 4 broke ValidateRequest="false"
for some reason.
解决方案是 - 只是把<的httpRuntime requestValidationMode =2.0/>
进入你的web.config文件
The solution is -- just put <httpRuntime requestValidationMode="2.0" />
into your web.config file.
与解决方案的问题在于,它打破了.NET 2.0的支持!
The problem with that solution is that it breaks support for .NET 2.0!
IIS拒绝接受在web.config中未知属性。此外,我不喜欢这样的全有或全无的性质。
IIS refuses to accept unknown attributes in web.config. Also I don't like the all or nothing nature of this.
我能为需要它的单页设置requestValidationMode(或以其他方式禁用请求验证)?如果没有与突破2.0 的web.config
的向后兼容性?
Can I set requestValidationMode (or in some other way disable request validation) for a single page that needs it? Without breaking backwards compatibility of web.config
with 2.0?
推荐答案
OK,貌似这个不能做,我只是很容易逃避数据,但我认为这是一个合理的问题 - 至少使这里注意,这不能做。
OK, looks like this can't be done and I can just escape the data easily, but I think this was a legitimate question -- at least to make a note here that this can't be done.
这篇关于ValidateRequest =“假”和.NET 4问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!