Click here to Skip to main content
15,914,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I am getting thread was being aborted error. I googled it and found it is because of Response.Redirect method.

I passed second parameter "false" but sometimes it still occur thread was being aborted. I have written following code in my page.

C#
Response.Redirect("Login.aspx",false");
return ; // to exit from the function.


Thanks
Imrankhan
Posted

1 solution

Try this:
C#
Response.Redirect("Login.aspx", true);



--Amit
 
Share this answer
 
Comments
Imran Khan Pathan 5-Jun-13 4:01am    
Amit, that will not work. If I do response end then thread abort exception will occur.
_Amy 5-Jun-13 4:14am    
Then you can try this:
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Success", "window.location.href = 'Login.aspx';", true);

--Amit

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900