The code format is as follows:
{
Response. Redirect ();
}
(Exception ex)
{
Response. Write (+ ex. ToString ());
}
Errors are always caught here:
System. Threading. ThreadAbortException: The thread is being aborted.
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)
In System. Web. HttpResponse. Redirect (String url), the original Response. Redirect will execute httpResponse. End (), which will always cause thread suspension errors. The modifications are as follows:
(System. Threading. ThreadAbortException e)
{
Debug. Write ();
}
(SqlException err2)
{
...
}
Add two or more layers of error capture. System. Threading. ThreadAbortException e does not need to be processed. It can only be added to other errors.