System.Threading.ThreadAbortException: Thread was being aborted
This exception occurs when you call Response.Redirect() or Response.Transfer(). You are pretty much guaranteed an exception, when these calls are inside a Try block! This is due to how the .NET 1.1 framework handles Try blocks.
This is how I understand the situation: the compiler puts try block code into a virtual method. Like the Main() method, it returns a result code, and a result code is expected to be returned. Response.Redirect() and Response.Transfer() cause the current thread to be aborted. It the thread aborts while in the Try block, the virtual method is unable to return a result code. There is doubtless some complications with handling Try block code as a virtual method, which is not conducive to stopping the thread.
- You should include the optional, second variable in your code, whenever possible. This second input parameter is a boolean value, indicating whether the page should finish rendering. (I haven't encountered any situations where I do!)
- Take the redirect or transfer call out of the Try block.