"Thread was being aborted" error when redirecting to another page

Posted by Poster under ASP.NET on 6/9/2009 | Views : 8246 | Status : [Member] | Replies : 1
I have a Login form in which after authentication has been done, I am redirecting the user to default.aspx page. This block of code has been written into the try block.

Every time when the user is redirected, the application throws error in the catch block saying " Thread was being aborted ..." (a ThreadAbortException), how to overcome this problem?


Posted by: Raja on: 6/9/2009 [Member] Starter

Use the overload of the Response.Redirect and pass false as the second parameter.

Response.Redirect("default.aspx", false);

Note that if you write Response.End() in the next line it will start throwing the same error again. So just write Response.Redirect() only do not write Response.End().


Raja, USA

Poster, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response