<%@ Page Language="C#" validateRequest="false" AutoEventWireup="true" CodeBehind="frmExcel.aspx.cs" Inherits="HDDZ.WEB.RealTime.frmExcel" %>
提交的内容是ExtJs grid生成的Excel 数据,xml格式的<html>
<head>
<title>从客户端(exportContent="<xml version="1.0" e...")中检测到有潜在危险的 Request.Form 值。</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.er {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head> <body bgcolor="white"> <span><H1>“/scada5”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1> <h2> <i>从客户端(exportContent="<xml version="1.0" e...")中检测到有潜在危险的 Request.Form 值。</i> </h2></span> <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> <b> 说明: </b>请求验证过程检测到有潜在危险的客户端输入值,对请求的处理已经中止。该值可能指示存在危及应用程序安全的尝试,如跨站点脚本攻击。若要允许页面重写应用程序请求验证设置,请将 httpRuntime 配置节中的 requestValidationMode 特性设置为 requestValidationMode="2.0"。示例: <httpRuntime requestValidationMode="2.0" />。设置此值后,可通过在 Page 指令或 <pages> 配置节中设置 validateRequest="false" 禁用请求验证。但是,在这种情况下,强烈建议应用程序显式检查所有输入。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkId=153133。
<br><br> <b> 异常详细信息: </b>System.Web.HttpRequestValidationException: 从客户端(exportContent="<xml version="1.0" e...")中检测到有潜在危险的 Request.Form 值。<br><br> <b>源错误:</b> <br><br> <table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>[没有相关的源行]</pre></code> </td>
</tr>
</table> <br> <b> 源文件: </b> c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\scada5\abdcae96\ca46d814\App_Web_ym1midaz.3.cs<b> 行: </b> 0
<br><br> <b>堆栈跟踪:</b> <br><br> <table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>[HttpRequestValidationException (0x80004005): 从客户端(exportContent="<xml version="1.0" e...")中检测到有潜在危险的 Request.Form 值。]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +8730740
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +122
System.Web.HttpRequest.get_Form() +114
System.Web.HttpRequest.get_HasForm() +8896111
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +69
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.realtime_frmexcel_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\scada5\abdcae96\ca46d814\App_Web_ym1midaz.3.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
</pre></code> </td>
</tr>
</table> <br> <hr width=100% size=1 color=silver> <b>版本信息:</b> Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.1 </font> </body>
</html>
<!--
[HttpRequestValidationException]: 从客户端(exportContent="<xml version="1.0" e...")中检测到有潜在危险的 Request.Form 值。
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.realtime_frmexcel_aspx.ProcessRequest(HttpContext context) 位置 c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\scada5\abdcae96\ca46d814\App_Web_ym1midaz.3.cs:行号 0
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
解决方案 »
- asp.net绑定图片
- 谁能推荐一个好的在线考试系统?
- 大家好,新站开张了
- 框架刷新问题
- 求助怎么样建立数据库(SQLserver)公用连接字符串,并调用.
- 空记录时,如何显示网页上DataGrid的标题栏呢?我在用DataGrid时,没有记录就完全不显示出来的,还请大虾们指点指点
- 自定义控件有属性BindingControlID,在VS.NET界面编辑时怎样在设置该属性时能显示页面的所有的控件(有DataSource属性)的ID以供选择。
- .net分表问题 文章是否要分表
- javascript 中 服务器块的格式 是怎么的? [解决立即结账]
- 在DataGrid中模版列上有RadioButton的问题
- ReportViewer做报表难题,请高手指教一二
- 如何取得gridview隐藏列的值?
这个就在被POSt的画面里。 frmExcel就是接受字符串生成Excel导出的
1.将 httpRuntime 配置节中的 requestValidationMode 特性设置为 requestValidationMode="2.0"。
示例: <httpRuntime requestValidationMode="2.0" />。
2.在 Page 指令或 <pages> 配置节中设置 validateRequest="false" 禁用请求验证。在ASP.NET 4.0中,请求验证功能被提前到IHttpHandler.BeginRequest这个方法被请求之前,这也就意味着所有进入ASP.NET请求通道的所有的HTTP请求都将会被进行请求内容合法性的验证,包括有的自定义HttpHandler,WebService请求,甚至于利用自定义Http Module进行自定义请求处理程序。
请求验证处理被提前的后果就是导致我们在页面,或者Controller中设置ValidateRequest=false,将会失效,无法阻止程序不去验证请求的输入内容了。因为这样做后,验证器无法得到请求的页面是否禁用了验证请求,因为还没有实例化HttpHandler。并且在ASP.NET4.0中,并没有提供给我一个地方去禁用这个验证功能。但是出于兼容性的考虑,ASP.NET允许我们通过在web.config中配置使用ASP.NET 2.0的请求验证行为:<httpRuntime requestValidationMode=”2.0″ />。
以上资料来自 阿不 的blog,详细情况在:http://www.cnblogs.com/hjf1223/archive/2010/04/17/1714148.html