Search code examples
c#asp.netresponse.redirecttry-finally

Response.Redirect() inside a try-finally


Possible Duplicate:
Will code in finally run after a redirect?

Hello,

What happens when I call a Response.Redirect() with EndResponse set to true/false inisde a try/finally block? Will the finally be called?


Solution

  • The finally block in a try/finally will always be called - that's the point of finally.

    Exceptions (minor) are described here: Conditions when finally does not execute in a .net try..finally block