今天突然遇到這個問題了!不過重新整理頁面後錯誤就沒有! 而且之前也沒有這個錯誤哦! ... 不過我還是去Google了一下答案!
Thread was being aborted :中文意思 線程被終止
引用地址:http://support.microsoft.com/default.aspx/kb/312629/EN-US/?p=1
原因:
那個 Response.End 方法結束頁的執行,並轉移到執行 的Application_EndRequest 事件在應用程式的事件管道。該行的代碼如下 Response.End 不會被執行。
此問題出現在 Response.Redirect 和 Server.Transfer方法 方法,因為這兩種方法調用 Response.End 在內部。
解決方案:
若要解決此問題,請使用下列方法之一:
為了 Response.End,調用 HttpContext.Current.ApplicationInstance.CompleteRequest 方法,而不是 Response.End 繞過的代碼執行 的Application_EndRequest 事件。
為了 Response.Redirect,使用過載, Response.Redirect(string URL,bool endResponse) 的推移 false 為 endResponse 參數壓制內部電話 Response.End。例如:
Response.Redirect(“nextpage.aspx”,false);
如果您使用此解決方案,下面的代碼 Response.Redirect 被執行。
為了 Server.Transfer方法,使用 使用Server.Execute 方法來代替。
另:盡量不要把Response.Redirect("targetUrl");語句寫在try裡面了! 使用Response.Redirect("targetUrl",false);
本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/jinho/archive/2010/03/11/5367242.aspx