Sunday, November 2, 2008

ThreadAbort within an Event Handlers in ASP.NET

If you attach multiple event handlers to an event, the handlers are executed in the order in which they were attached. If an event handler appearing earlier causes a ThreadAbortException (such as when calling Response.Redirect), the later event handlers are skipped.

This is an issue when a button has an event handler on the page to navigate to another page but the event is also handled by user controls to save data. Just one of those not-so-common scenarios......