Http://www.cnblogs.com/jkswjw/archive/2009/03/05/1403639.html
Try
{
...
Response. Redirect ("/Mymaimai. aspx ");...
}
Catch (exception E)
{
// Exception Handling
}
If you use the preceding statements, system. Threading. threadabortexception will be thrown regardless of whether an exception exists.:
The response. End method stops page execution and converts the execution to the application_endrequest event in the event pipeline of the application. The code lines after response. End are not executed.
This problem occurs in the response. Redirect and server. transfer methods, because both methods call response. End internally.
Solution
To solve this problem, use one of the following methods:
For response. End, call applicationinstance. completerequest instead of response. End to skip the code execution of the application_endrequest event.
For response. Redirect, use the overload response. Redirect (string URL, bool endresponse) to pass false to the endresponse parameter to cancel internal calls to response. End. For example:
Response. Redirect ("/mymaimai. aspx", false); if this solution is used, the Code following response. Redirect will be executed.
For server. Transfer, use the server. Execute method.
Status
This phenomenon is caused by design.
Code after solution:
Try
{
Response. Redirect ("/mymaimai. aspx", False );
}
Catch
{
// Exception Handling
}