Reason
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. 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 Application_ The code execution for the EndRequest event.
• for Response.Redirect, use an overloaded Response.Redirect (String URL, bool endresponse), which passes false to the Endresponse parameter to cancel the Respons Internal invocation of the e.end.
For example: Response.Redirect ("nextpage.aspx", false);
Original: http://www.cnblogs.com/linyechengwei/archive/2009/11/18/1605377.html
[Bug] Resolution of the expression cannot be evaluated because the code has been optimized or the native frame is above the call stack (GO)