Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net IE 10-回发或回调参数无效_Asp.net_Internet Explorer_Web Applications_Callback - Fatal编程技术网

Asp.net IE 10-回发或回调参数无效

Asp.net IE 10-回发或回调参数无效,asp.net,internet-explorer,web-applications,callback,Asp.net,Internet Explorer,Web Applications,Callback,我们的一个应用程序中有一个报表生成器,它是在.NET 2.0中构建的 每当我们尝试在IE 10中运行报告时,都会收到服务器错误,并显示以下消息: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="tr

我们的一个应用程序中有一个报表生成器,它是在.NET 2.0中构建的

每当我们尝试在IE 10中运行报告时,都会收到服务器错误,并显示以下消息:

Invalid postback or callback argument.  Event validation is enabled using 
<pages enableEventValidation="true"/> in configuration or 
<%@ Page EnableEventValidation="true" %> in a page.  
For security purposes, this feature verifies that arguments to postback or callback 
events originate from the server control that originally rendered them.  If the data is 
valid and expected, use the ClientScriptManager.RegisterForEventValidation method in 
order to register the postback or callback data for validation. 
Description: An unhandled exception occurred during the execution of the current web 
request. Please review the stack trace for more information about the error and where it 
originated in the code. 


Exception Details: System.ArgumentException: Invalid postback or callback argument.      
Event validation is enabled using <pages enableEventValidation="true"/> 
in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security   
purposes, this feature verifies that arguments to postback or callback events originate 
from the server control that originally rendered them.  If the data is valid and 
expected, use the ClientScriptManager.RegisterForEventValidation method in order to 
register the postback or callback data for validation.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. 
Information regarding the origin and location of the exception can be identified using   
the exception stack trace below.  

Stack Trace: 

[ArgumentException: Invalid postback or callback argument.  Event validation is enabled 
using <pages enableEventValidation="true"/> in configuration or <%@ Page 
EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies 
that arguments to postback or callback events originate from the server control that 
originally rendered them.  If the data is valid and expected, use the 
ClientScriptManager.RegisterForEventValidation method in order to register the postback 
or callback data for validation.]
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +8636377
   System.Web.UI.WebControls.ListBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +360
   System.Web.UI.WebControls.ListBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +13
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +343
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.5420; ASP.NET      
Version:2.0.50727.5420 
回发或回调参数无效。使用启用事件验证
在配置上或
在一页中。
出于安全目的,此功能验证回发或回调的参数是否正确
事件源于最初呈现它们的服务器控件。如果数据是
有效且应为,请在中使用ClientScriptManager.RegisterForEventValidation方法
以注册回发或回调数据以进行验证。
描述:在执行当前网站时发生未处理的异常
要求请查看堆栈跟踪以了解有关错误及其位置的更多信息
源于代码。
异常详细信息:System.ArgumentException:回发或回调参数无效。
使用启用事件验证
在配置或页面中。为了安全
为此,此功能验证回发或回调事件的参数是否起源
从最初呈现它们的服务器控件。如果数据有效且
应使用ClientScriptManager.RegisterForEventValidation方法,以便
注册回发或回调数据以进行验证。
源错误:
在执行当前web请求期间生成了未经处理的异常。
有关异常来源和位置的信息可以使用
下面是异常堆栈跟踪。
堆栈跟踪:
[ArgumentException:回发或回调参数无效。已启用事件验证
在配置或页面中使用。出于安全目的,此功能验证
回发或回调事件的参数源自
最初呈现它们。如果数据有效且符合要求,请使用
ClientScriptManager.RegisterForEventValidation方法以注册回发
或用于验证的回调数据。]
System.Web.UI.ClientScriptManager.ValidateEvent(字符串唯一ID,字符串参数)+8636377
System.Web.UI.WebControl.ListBox.LoadPostData(字符串postDataKey,NameValueCollection postCollection)+360
System.Web.UI.WebControl.ListBox.System.Web.UI.IPostBackDataHandler.LoadPostData(字符串postDataKey,NameValueCollection postCollection)+13
System.Web.UI.Page.ProcessPostData(NameValueCollection postData,布尔fBeforeLoad)+343
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+1743
--------------------------------------------------------------------------------
版本信息:Microsoft.NET Framework版本:2.0.50727.5420;ASP.NET
版本:2.0.50727.5420
只有在IE 10中运行报告时,才会发生此错误

如果我们使用任何其他IE版本或任何其他浏览器,我们不会得到任何错误,报告运行正常

根据Microsoft文档,这在.NET3及更高版本上得到了解决。但我们已经有了.NET3.5,但仍然无法在IE10上运行

这是页面标题:

<%@ Page EnableEventValidation="true" Language="VB"  %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Client_Id.Value = Request.QueryString("Client_Id")
    Project_Id.Value = Request.QueryString("Project_Id")
    System_Id.Value = Request.QueryString("System_Id")
    Report_Page_Heading.Text = Replace(Request.QueryString("H"), "'", "")


    PartExportFields.SelectParameters.Add("Client_Id", Replace(Client_Id.Value, "'", ""))
    PartExportFields.SelectParameters.Add("Project_Id", Replace(Project_Id.Value, "'", ""))
    PartExportFields.SelectParameters.Add("System_Id", Replace(System_Id.Value, "'", ""))

    SavedCustomReports.SelectParameters.Add("Client_Id", Replace(Client_Id.Value, "'", ""))
    SavedCustomReports.SelectParameters.Add("Project_Id", Replace(Project_Id.Value, "'", ""))
    SavedCustomReports.SelectParameters.Add("System_Id", Replace(System_Id.Value, "'", ""))

    ListBox1.SelectedValue = Request.QueryString("edit")
End Sub

Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

    Page.ClientScript.RegisterForEventValidation("Client_Id", Replace(Client_Id.Value, "'", ""))
    Page.ClientScript.RegisterForEventValidation("Project_Id", Replace(Project_Id.Value, "'", ""))
    Page.ClientScript.RegisterForEventValidation("System_Id", Replace(System_Id.Value, "'", ""))
    MyBase.Render(writer)
End Sub    
</script>

受保护的子页加载(ByVal sender作为对象,ByVal e作为System.EventArgs)
Client\u Id.Value=Request.QueryString(“Client\u Id”)
Project\u Id.Value=Request.QueryString(“Project\u Id”)
System\u Id.Value=Request.QueryString(“System\u Id”)
Report\u Page\u Heading.Text=Replace(Request.QueryString(“H”),“,”)
PartExportFields.SelectParameters.Add(“客户端Id”,替换(客户端Id.Value,”,“”)
PartExportFields.SelectParameters.Add(“项目Id”,替换(项目Id.Value,”,“”)
PartExportFields.SelectParameters.Add(“系统Id”,替换(系统Id.Value,”,“”)
SavedCustomReports.SelectParameters.Add(“客户端Id”,替换(客户端Id.Value,“,”))
SavedCustomReports.SelectParameters.Add(“项目Id”,替换(项目Id.Value,”,“”)
SavedCustomReports.SelectParameters.Add(“系统Id”,替换(系统Id.Value,”,“”)
ListBox1.SelectedValue=Request.QueryString(“编辑”)
端接头
受保护的子列表框1_SelectedIndexChanged(ByVal sender作为对象,ByVal e作为System.EventArgs)
端接头
受保护的子文本框1u TextChanged(ByVal sender作为对象,ByVal e作为System.EventArgs)
端接头
受保护的覆盖子呈现(ByVal编写器作为System.Web.UI.HtmlTextWriter)
Page.ClientScript.RegisterForEventValidation(“Client\u Id”,Replace(Client\u Id.Value,“,”))
Page.ClientScript.RegisterForEventValidation(“项目Id”,替换(项目Id.Value,“,”))
Page.ClientScript.RegisterForEventValidation(“System\u Id”,Replace(System\u Id.Value,“,”))
MyBase.Render(编写器)
端接头
任何想法或帮助都会很好


提前谢谢

我在IE 10上遇到了类似的问题。IE 10不能很好地处理webforms(讽刺的是,Microsoft技术不能与Microsoft技术协同工作)。看这个。您可以应用一些机器范围的修补程序来修复一些问题。另外,使用一些微软的Ajax技术在IE 10中根本不起作用。我唯一能够解决这个问题的方法是发送一个标题,告诉IE在IE 9模式下运行页面。

我找到的唯一解决方案是运行Windows Update

这下载了IE的所有必要修复程序

之后错误就消失了