Symptoms If you use
Response.End、
Response.RedirectOr
Server.TransferMethod that will appear
ThreadAbortExceptionAbnormal. You can use
Try-catchStatement to catch this exception. Reason
Response.EndMethod terminates the execution of the page and switches this execution to the application's event pipeline.
Application_EndRequestEvent. Do not execute
Response.EndThe following line of code.
This issue occurs in
Response.RedirectAnd
Server.Transfermethod, because both of these methods are internally called
Response.End。 Solution to resolve this issue, use one of the following methods: 1. For
Response.EndCall
HttpContext.Current.ApplicationInstance.CompleteRequestMethod rather than
Response.EndTo skip
Application_EndRequestThe code execution for the event. 2. For
Response.Redirect, use the overloaded
response.redirect (String URL, bool endresponse), the overload pairs the
endresponseParameter passing
falseTo cancel the
Response.EndInternal invocation of the. For example:
Response.Redirect ("nextpage.aspx", false);
If you use this workaround, you will perform a
Response.RedirectThe following code 3. For
Server.Transfer, use
Server.ExecuteMethod. Reference: http://blog.sina.com.cn/s/blog_67a3453d0101bn2b.html
System.Threading.ThreadAbortException: Aborting Thread