When I use Response.Redirect(...) to redirect my form to a new page I get the error:
A first chance exception of type \'System.Threading.ThreadAbortEx
Response.Redirect()
throws an exception to abort the current request.
This KB article describes this behavior (also for the Request.End()
and Server.Transfer()
methods).
For Response.Redirect()
there exists an overload:
Response.Redirect(String url, bool endResponse)
If you pass endResponse=false, then the exception is not thrown (but the runtime will continue processing the current request).
If endResponse=true (or if the other overload is used), the exception is thrown and the current request will immediately be terminated.