Invalid postback or callback argument.
Event validation is enabled usingin 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.ArgumentException: Untrapped
Exception: Invalid postback or
callback argument. Event validation
is enabled using in
configuration or <%@ Page
EnableEventValidation=”true” %> in a
page. For security purposes,use the
ClientScriptManager.RegisterForEventValidation
method in order to register the
postback or callback data for
validation.] at
System.Web.UI.ClientScriptManager.ValidateEvent(String
uniqueId,String argument) at
System.Web.UI.Control.ValidateEvent(String
uniqueID,String eventArgument) at
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl,String eventArgument)
at
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint,Boolean
includeStagesAfterAsyncPoint)
提交表单后出现异常,然后在页面重新加载之前快速单击LinkButton以在同一页面上下载文件.
有人可以解释为什么在执行上述操作时发生此异常的细节?
提前致谢!
解决方法
>您正在进行创建新输入或克隆现有输入的客户端方法.
>在处理表单提交时,.NET会对LinkButton执行某些操作,导致它不再可用.我遇到的一些例子是你的LinkButton是在后端动态创建的,或者你正在使用UpdatePanels,并且在表单提交过程中它们的内容会被更改.
基本上,我相信如果您单步执行表单提交代码并观察LinkButton,您将看到.NET忘记它,当单击LinkButton时可以理解地触发此“安全例外”.