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 拷贝内容进去的 ...
随机推荐
- js 删除数组几种方法
var arr=['a','b','c']; 若要删除其中的'b',有两种方法: 1.delete方法:delete arr[1] 这种方式数组长度不变,此时arr[1]变为undefined了,但是 ...
- centos7永久更改主机名
操作环境: [root@bogon ~]# uname -a Linux #localhost.localdomain 3.10.0-514.el7.centos.plus.i686 #1 SMP W ...
- php中的后期静态绑定
后期静态绑定PHP手册 使用的保留关键字: static 定义: static:: 不再被解析为定义当前方法所在的类,而是在实际运行时计算的.也可以称之为"静态绑定",因为它可以用 ...
- 【Android】Android6.0发送短信Demo
整理一下使用SmsManager类发送短信的方法. https://developer.android.com/reference/android/telephony/SmsManager.html ...
- Spring WebSocket初探2 (Spring WebSocket入门教程)<转>
See more: Spring WebSocket reference整个例子属于WiseMenuFrameWork的一部分,可以将整个项目Clone下来,如果朋友们有需求,我可以整理一个独立的de ...
- Java 源码赏析 - java.lang - Void
被人鄙视了,于是也来读读源码... package java.lang; /** * The Void class is an uninstantiable placeholder class to ...
- c# 自定义类型的DataBindings
自定义类型TextBoxEx,扩展了TextBox,增加了一个属性KeyText来保存后台的值(Tag已另作它用). 程序里面需要将KeyText和DataTable的某个列绑定起来. 如果是Text ...
- RavenDb学习(十)附件,存储大对象
.读取 Raven.Abstractions.Data.Attachment attachment = documentStore.DatabaseCommands.GetAttachment(&qu ...
- 如何在Linux系统上安装字体
libreoffice添加字体 TrueType字体文件的扩展名是.ttf,ttf就是TrueType Font的首字母缩写 一般在 /usr/share/fonts/truetype/ 目录下,这个 ...
- node学习笔记5——post数据传递
上一篇有讲到get数据的传递.有了上一篇的了解,今天讲下如何获取到post传递过来的数据. 通过post传送的数据,在node里面主要是通过req.on('data',function (data) ...