A potentially dangerous Request.Path value was detected from the client异常解决方案
场景:
当URL中存在“<,>,*,%,&,:,/”特殊字符时,页面会抛出A potentially dangerous Request.Path value was detected from the client异常。
原因:
是ASP.NET默认的拦截机制,保证页面URL传输的一定安全性。
解决方案有两种:
第一种,直接去除页面请求危险字符验证:
在web.config配置文件的<system.web>节点下添加代码如下:
<system.web>
<httpRuntime requestValidationMode="2.0"/>
<pages validateRequest="false" clientIDMode="AutoID"/>
</system.web>
第二种,设置哪些危险字符需要被验证:
<system.web>
<httpRuntime requestPathInvalidCharacters="<,>,*,%,:,&,/" />
</system.web>
注意其中的requestPathInvalidCharacters是一个以逗号分隔的无效字符列表。默认不存在此键值对时,意味着受限制的无效字符集(以,分割)是这7个:<,>,*,%,&,:,/
如果你想这些字符全部不受限制,就应该设置requestPathInvalidCharacters="";
如果你想部分字符受限制,就需要在requestPathInvalidCharacters中设置需要受限制的字符;例如:requestPathInvalidCharacters="<,>"。
A potentially dangerous Request.Path value was detected from the client异常解决方案的更多相关文章
- [BILL WEI] A potentially dangerous Request.Path value was detected from the client 异常处理办法
我们在ASP.net中使用URL导向后, 我们在访问某个地址,或者打开某个系统页面的时候,就会报错误: A potentially dangerous Request.Path value was d ...
- 解决.Net 4.0 A potentially dangerous Request.Form value was detected from the client 异常
在web.config中加入 <httpRuntime maxRequestLength="22000" executionTimeout="43200" ...
- A potentially dangerous Request.Form value was detected from the client问题处理
问题剖析: 用户在页面上提交表单到服务器时,服务器会检测到一些潜在的输入风险,例如使用富文本编辑器控件(RichTextBox.FreeTextBox.CuteEditor等)编辑的内容中包含有HTM ...
- 自己留存:小经验在asp.net 4.5或者asp.net mvc 5解决A potentially dangerous Request.Form value was detected from the client
以前的解决办法是 <configuration> <system.web> <pages validateRequest="false&q ...
- A potentially dangerous Request.Form value was detected from the client
提交表单中包含特殊字符如<script>可能被认为是跨站攻击代码:解决方法很多,如stackoverflow上的web.config中加设置的方法不中肯[如原贴中Jamie M所说],主要 ...
- A potentially dangerous Request.Form value was detected from the client的解决办法
网上找了这么多,这条最靠谱,记录下来,以备后用 <httpRuntime requestValidationMode="2.0"/> <pages validat ...
- ASP.NET 4.0 potentially dangerous Request.Form value was detected
A few days ago, while working on an ASP.NET 4.0 Web project, I got an issue. The issue was, when use ...
- System.Web.HttpRequestValidationException: A potentially dangerous Request.F
ASP.NET .0验证请求 System.Web.HttpRequestValidationException: A potentially dangerous Request.F System.W ...
- ASP.NET 4.0验证请求 System.Web.HttpRequestValidationException: A potentially dangerous Request.F
System.Web.HttpRequestValidationException: A potentially dangerous Request.F 在使用类似eWebedtior 拷贝内容进去的 ...
随机推荐
- 使用 WebSphere ILOG JRules 开发保险应用系统
使用 WebSphere ILOG JRules 开发保险应用系统 概述 保险行业在国内是一个充分竞争的行业,竞争的加剧导致保险公司的业务管理等各项费用在增长.而保险公司业务支撑系统的先进性与灵活支撑 ...
- plot sin 动态配置rc settings
plot sin 动态配置rc settings 坐标轴颜色 线的颜色 绘图前景色 Code #!/usr/bin/env python # -*- coding: utf-8 -*- import ...
- 腾讯云CentOS升级JDK1.8
1.查看CentOS自带JDK是否已安装. yum list installed |grep java. 2.卸载原有JDK yum -y remove java-1.5.0-gcj.i686 3.查 ...
- C语言 · 乘法运算
算法提高 乘法运算 时间限制:1.0s 内存限制:512.0MB 问题描述 编制一个乘法运算的程序. 从键盘读入2个100以内的正整数,进行乘法运算并以竖式输出. 输入格式 输入只有 ...
- Java编程的逻辑 (73) - 并发容器 - 写时拷贝的List和Set
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...
- Hbase 学习(十一)使用hive往hbase当中导入数据
我们可以有很多方式可以把数据导入到hbase当中,比如说用map-reduce,使用TableOutputFormat这个类,但是这种方式不是最优的方式. Bulk的方式直接生成HFiles,写入到文 ...
- ubuntu14.04 64位 安装搜狗输入法
deb格式的搜狗输入法,搜狗拼音官网可以下载到 http://pinyin.sogou.com/linux/?r=pinyin (64位) 2.使用deb安装工具gdebi,这个工具能解决所有依赖问题 ...
- css实现圆形头像
<div style="width:400px; height:90px; padding-left:10px; padding-top:10px; background-color: ...
- Java finally语句是在try或catch的retrurn之前还是之后执行
若try或catch中没有return语句,则按正常执行流,从上到下,finally里的所有修改都生效. 这里讨论的是try或catch里有return或throw语句的情形,此情形比较让人迷惑. 总 ...
- Linux抓包工具
tcpdump -i em1 host 1.203.80.138 -w ~/aa.data 使用em1网卡,网卡可以通过命令ifconfig查看 host:目的或源地址是1.203.80.138的网络 ...