同一次PostBack被处理了两次,还有谁遇到过?
一下是我调试时的堆栈跟踪:
第一次
System.Web.dll!System.Web.UI.DataSourceView.Delete(System.Collections.IDictionary keys, System.Collections.IDictionary oldValues, System.Web.UI.DataSourceViewOperationCallback callback = {System.Web.UI.DataSourceViewOperationCallback}) + 0x28 字节
System.Web.dll!System.Web.UI.WebControls.GridView.HandleDelete(System.Web.UI.WebControls.GridViewRow row, int rowIndex) + 0x3a0 字节
System.Web.dll!System.Web.UI.WebControls.GridView.HandleEvent(System.EventArgs e, bool causesValidation, string validationGroup) + 0x484 字节
System.Web.dll!System.Web.UI.WebControls.GridView.RaisePostBackEvent(string eventArgument) + 0xc8 字节
System.Web.dll!System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + 0x8 字节
System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Web.UI.IPostBackEventHandler sourceControl, string eventArgument) + 0xc 字节
System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Collections.Specialized.NameValueCollection postData) + 0xaf 字节
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x13ef 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x4d 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x57 字节
System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x13 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 字节
App_Web_kbvn7yue.dll!ASP.base_company_salarystdlist_aspx.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) + 0x2f 字节 C#
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x9b 字节
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x41 字节
System.Web.dll!System.Web.HttpApplication.ResumeSteps(System.Exception error) + 0x163 字节
System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x91 字节
System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {System.Web.Hosting.ISAPIWorkerRequestOutOfProc}) + 0x12d 字节
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x62 字节
System.Web.dll!System.Web.Hosting.ISAPIRuntime.ProcessRequest(System.IntPtr ecb, int iWRType) + 0x57 字节
[应用程序域转换]
[本机到托管的转换]
第二次
System.Web.dll!System.Web.UI.DataSourceView.Delete(System.Collections.IDictionary keys, System.Collections.IDictionary oldValues, System.Web.UI.DataSourceViewOperationCallback callback = {System.Web.UI.DataSourceViewOperationCallback}) + 0x28 字节
System.Web.dll!System.Web.UI.WebControls.GridView.HandleDelete(System.Web.UI.WebControls.GridViewRow row, int rowIndex) + 0x3a0 字节
System.Web.dll!System.Web.UI.WebControls.GridView.HandleEvent(System.EventArgs e, bool causesValidation, string validationGroup) + 0x484 字节
System.Web.dll!System.Web.UI.WebControls.GridView.RaisePostBackEvent(string eventArgument) + 0xc8 字节
System.Web.dll!System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + 0x8 字节
System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Web.UI.IPostBackEventHandler sourceControl, string eventArgument) + 0xc 字节
System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Collections.Specialized.NameValueCollection postData) + 0xaf 字节
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x13ef 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x4d 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x57 字节
System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x13 字节
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 字节
App_Web_kbvn7yue.dll!ASP.base_company_salarystdlist_aspx.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) + 0x2f 字节 C#
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x9b 字节
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x41 字节
System.Web.dll!System.Web.HttpApplication.ResumeSteps(System.Exception error) + 0x163 字节
System.Web.dll!System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(System.Exception error) + 0x2d 字节
System.Web.dll!System.Web.HttpApplication.AsyncEventExecutionStep.ResumeStepsWithAssert(System.Exception error) + 0x28 字节
System.Web.dll!System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(System.IAsyncResult ar) + 0x93 字节
System.Web.dll!System.Web.HttpAsyncResult.Complete(bool synchronous, object result, System.Exception error) + 0x35 字节
System.Web.dll!System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(object state) + 0x11e 字节
mscorlib.dll!System.Threading._TimerCallback.TimerCallback_Context(object state) + 0x1a 字节
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x43 字节
[本机到托管的转换]
[托管到本机的转换]
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0xa7 字节
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x92 字节
mscorlib.dll!System.Threading._TimerCallback.PerformTimerCallback(object state) + 0x5b 字节
[应用程序域转换]
我发现有很多人提出同一个事件被触发两次的问题,有一些是与AutoEventWireup,有关,但是这里的问题表面上却不是!
这里的代码是在一个GridView的删除操作后跟踪到的,GridView我继承并重写了PerformDataBinding方法。我曾经在国外的论坛上看到说,这与执行删除的Button是ImageButton有关,不知道是否属实(我还没有试过)!