ThreadAbortException starts:Thread was being aborted while using response.redirect

Posted by Gopal_Nivas under ASP.NET on 2/21/2012 | Points: 10 | Views : 2415 | Status : [Member] | Replies : 0

I received the below error while redirecting one page to another page using response.redirect.

i was calling my page from third party site.

my content.aspx page is in root.but my redirect page is in a folder.

then it will come to this page and hit the response.redirect but it doesnot go to my required page.
here i used forms authentication for automatic login.

i used membership concepts.

"ThreadAbortException starts:Thread was being aborted."

this is my code:
MembershipUser User = Membership.GetUser(email.ToString());
if (User != null)
clsExHandler.Instance.Write("add form authentication");
FormsAuthentication.SetAuthCookie(_CheckAC.Email, false);
clsExHandler.Instance.Write("try starts");

Response.Redirect("~/Admin/Title/content.aspx?Id=" + Id.ToString());
catch (ThreadAbortException ex)
clsExHandler.Instance.Write("ThreadAbortException starts");
clsExHandler.Instance.Write("ThreadAbortException starts:"+ex.Message.ToString());
// Do nothing. ASP.NET is redirecting.
// Always comment this so other developers know why the exception
// is being swallowed.
catch (Exception ex)
// Log other types of exception.


how to handle this..

need ur suggestions..


(No response found.)

Login to post response