1

I'm aware that when you call Response.Redirect it fires a ThreadAbortException. A co-worker has demonstrated calling response.redirect and then it goes to the global.asax.

For the life of me I cannot get the ThreadAbortException to go to the global.asax, its like it is being suppressed naturally in the system.

The reason I'm asking this is we believe the response.redirect is the cause of some automated error emails, but I'm not convinced this is the case especially if I can't even get it to debug into the global.asax.

Any Ideas why I can't get the Response.Redirect to fire the global error handler?

vendettamit
  • 14,315
  • 2
  • 32
  • 54
mgmedick
  • 686
  • 7
  • 23
  • 1
    http://stackoverflow.com/questions/2777105/response-redirect-causes-system-threading-threadabortexception – MK. Jun 24 '13 at 20:50
  • I'm aware of what to do in order not to fire the exception. Regardless, when the exception does fire...it does not go to my global. – mgmedick Jun 24 '13 at 20:56
  • Yeah, I'm somewhat confused. I've never seen Response.Redirect to to global.asax handler. – MK. Jun 24 '13 at 21:04
  • Yea I think it is suppressed, I can't recreate. By suppressed I mean its just not making it to the global.aspx – mgmedick Jun 24 '13 at 21:14

1 Answers1

1

Looks like with the website the response.redirect doesn't go to the global. But with a web application a response.redirect will in fact go strait to the global. This is just through visual studio debugger.

As for how the both behave under IIS I don't know, but I got my answer, which is basically no I'm not crazy :). A response.redirect call does not go to the global in the case of a website, and it does in the case of a web application. Also it has nothing to do with the web.config, its just because the 2 compile and debug differently.

mgmedick
  • 686
  • 7
  • 23