Xpode.com        Click here to Print this article.

Getting 'Thread was being aborted'

Some time we use Response.End, Response.Redirect or Server.Transfer, a error generated "Thread was being aborted" and comes in Catch Block.

This problem occurs in the Response.Redirect and Server.Transfer methods because both methods call Response.End internally. The Response.End method ends the page execution and shifts the execution to the Application_EndRequest. The code follows Response.End is not executed.

To remove this we need to enter the

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

ThanksPage.aspx is page where we are redirecting.


Contributed by:
Rohit kakria
I am software developer

Resourse address on xpode.com

Click here to go on website