A potentially dangerous Request.Form解决方法

时间:2026-02-14 09:20:55

1、登录到服务器或者链接ftp找到网站所在文件夹。

A potentially dangerous Request.Form解决方法

2、找到根目录下的配置文件,web.config,打开文件,进行编辑。

A potentially dangerous Request.Form解决方法

3、在<system.web></system.web>标签之中加入代码,<%@ Page validateRequest="false"%>,因为默认情况下是这个属性是true。

A potentially dangerous Request.Form解决方法

4、如果是.net 4.0之前的版本,做完这部分工作,就可以看到这个问题已经解决了,但是如果是.net 4.0和之后的版本。则还需加入配置代码:    <compilation debug="true" targetFramework="4.0"/>    <httpRuntime requestValidationMode="2.0"/>

A potentially dangerous Request.Form解决方法

5、保存文件,再次测试功能,完成。

A potentially dangerous Request.Form解决方法

© 2026 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com