解决方案
要解决此问题,请使用下列方法之一:
1. 对于 Response.End,调用 HttpContext.Current.ApplicationInstance.CompleteRequest 方法而不是 Response.End 以跳过 Application_EndRequest 事件的代码执行。
2. 对于
Response.Redirect,请使用重载
Response.Redirect(String url, bool endResponse),该重载对
endResponse 参数传递
false 以取消对
Response.End 的内部调用。例如:
Response.Redirect ("nextpage.aspx", false);
如果使用此替代方法,将执行
Response.Redirect 后面的代码
3. 对于 Server.Transfer,请改用 Server.Execute 方法。
引用:http://blog.sina.com.cn/s/blog_67a3453d0101bn2b.html