Some of the problems that have arisen in recent systems are not quite clear, and threadabortexception occur when using Response.End, Response.Redirect, or Server.Transfer,
Originally the system is no problem, in the preservation of data can also be normal, originally used Try-catch statement is used to catch an abnormal situation, but the system is normal, the old capture to the following things
##[Action record]:2007-11-23 9:25:12 System.Threading.ThreadAbortException: Aborting thread.
In System.Threading.Thread.AbortInternal ()
In System.Threading.Thread.Abort (Object stateInfo)
In System.Web.HttpResponse.End ()
In System.Web.HttpResponse.Redirect (String URL, Boolean endresponse)
At System.Web.HttpResponse.Redirect (String URL)
Symptoms
If you use the Response.End, Response.Redirect, or Server.Transfer methods, a ThreadAbortException exception occurs. You can use the Try-catch statement to catch this exception.
Reason
<!--Inject Script Filtered--
The Response.End method terminates the execution of the page and switches this execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed.
This problem occurs in the Response.Redirect and Server.Transfer methods, because both methods call Response.End internally.
Solution Solutions
To resolve this issue, use one of the following methods: For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to skip The code execution for the Application_EndRequest event.
For Response.Redirect, use the overloaded Response.Redirect (String URL, bool endresponse), which passes false to the Endresponse parameter to cancel the Response.End Internal invocation of the. For example:
Response.Redirect ("Nextpage.aspx", false);
If you use this workaround, the code that follows Response.Redirect is executed.
For Server.Transfer, use the Server.Execute method instead.
"Go" ASP "aborting thread" error cause