gpt4 book ai didi

asp.net-mvc - requestValidationMode ="2.0"实际上做了什么?

转载 作者:行者123 更新时间:2023-12-01 20:09:19 26 4
gpt4 key购买 nike


我正在尝试解决“从客户端检测到潜在危险的 Request.Form 值”问题,并且答案和 Scott Hanselman推荐设置

<httpRuntime requestValidationMode="2.0" />

在 Web.config 中(以及向有问题的方法添加属性)。
我意识到这将验证模式更改为 ASP.NET 2.0,但这意味着什么?
另外,此更改是否有我应该注意的副作用?

谢谢。

最佳答案

查看MSDN's HttpRuntimeSection.RequestValidationMode Property处的描述.

2.0. Request validation is enabled only for pages, not for all HTTP requests. In addition, the request validation settings of the pages element (if any) in the configuration file or of the @ Page directive in an individual page are used to determine which page requests to validate.

关于asp.net-mvc - requestValidationMode ="2.0"实际上做了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6206540/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com