【问题标题】:Application error on Page, what i am doing wrong?页面上的应用程序错误,我做错了什么?
【发布时间】:2010-11-22 05:34:29
【问题描述】:

我有一个基本的网络论坛,人们填写并发送电子邮件。我在网站上有大约两打。由于某种原因,其中一个不能在 IE 中工作。它可以在 Firefox、Chrome、Opera 等中正常运行和发送...

IE error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Invalid postback or callback argument. Event validation is enabled using 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 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.

来源错误:

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.

堆栈跟踪:

[ArgumentException: Invalid postback or callback argument. Event validation is    enabled     

在配置中使用或在页面中使用 。出于安全目的,此功能验证回发或回调事件的参数是否源自最初呈现它们的服务器控件。如果数据有效且符合预期,请使用 ClientScriptManager.RegisterForEventValidation 方法以注册
用于验证的回发或回调数据。] System.Web.UI.ClientScriptManager.ValidateEvent(字符串 uniqueId,字符串参数)+159 System.Web.UI.Control.ValidateEvent(字符串唯一ID,字符串事件参数)+108 System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey,
NameValueCollection postCollection) +55 System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(字符串 postDataKey,NameValueCollection postCollection)+11 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +353

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean      
includeStagesAfterAsyncPoint) +1194

【问题讨论】:

    标签: c#


    【解决方案1】:

    它内置不接受 html 或 IIS 服务器 aspx 页面上的代码。

    这是一个需要添加的安全风险,但它会让一切都飞到服务器上。

    <%@ Page ValidateRequest="false"
    

    您可能应该在客户端对数据进行编码,以便它安全地飞到服务器。

    在服务器端获取所有数据,然后在那里验证.. 由你决定

    【讨论】:

      猜你喜欢
      • 2016-06-10
      • 2020-09-30
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      • 1970-01-01
      • 1970-01-01
      • 2010-10-12
      • 2013-11-25
      相关资源
      最近更新 更多