tags:

views:

890

answers:

4

I am getting a " Thread was being aborted " Exception in an ASP.NET page.I am not at all using any Response.Redirect/Server.Transfer method.Can any one help me to solve this ?

A: 

Do you have a call stack / exception details?

Andrei Rinea
IMHO, don't use an answer to ask a question, use comments.
TheSoftwareJedi
@TheSoftwareJedi : sorry...
Andrei Rinea
A: 

Yes i am using a nested Try -catch block in my code

Shyju
don't use an answer to answer an answer. use comments!
TheSoftwareJedi
A: 

The bad solution is using

Response.Redirect(URL, False)

which will cause not to Response.End() current page, however be careful this might lead problems because rest of the page will get executed and might cause login bypass and similar security and performance issues.

Edit : Apparently you are not using Response.Redirect and you can't catch AbortThreadExecution with Try Catch, which means this answer is totally useless now :)

Although to able to get an answer you need to learn how to ask a question. you need to provide information such as :

  • Exception details
  • When it, what are the symptoms
  • What have you tried and didn't work
  • Have you manage the isolate the problem?
dr. evil
you can't catch a ThreadAbortException and prevent its being rethrown
TheSoftwareJedi
note, you CAN catch the exception, but it will rethrow itself upon exiting the catch block. @Slough, you'd be better off just deleting this answer, and making some comments requesting more info.
TheSoftwareJedi
@TheSoftwareJedi : you murdered us :))
Andrei Rinea
+1  A: 

This can happen if the web app is being shut down or forcefully restarted while your code executes. I have seen this happen when your web app writes files to the web directory in which it's hosted, causing a recompile of the web app.

TheSoftwareJedi

related questions