ASP.Net Page and Control Lifecycle

There are many descriptions of ASP.Net page and control lifecycles, but most of them lack the detail of interaction between pages and controls.

I was surprised today by the fact that a UserControl’s OnInit fired before the Page’s OnInit event, which is quite unintuitive. On the other hand, the naming could be more descriptive; does anybody need event names like OnInit, OnPreInit, OnPostInit, OnIntermediateInitButNotQuiteDone ?

Here is the MSDN information on the Page Object Model, Page Lifecycle, and Control Lifecycle. But this information is not really useful when you want to know how pages and masterpages and controls interact.

Unfortunately the internet is full of dead links.

This page offers all the information you need to have, resulting from tracing literally every event an ASP.Net object handles. And this page here gives a graphical representation of the sequence of events.

Enjoy 🙂

2 thoughts on “ASP.Net Page and Control Lifecycle

  1. Pingback: ASP.Net Page_Load and Page_LoadComplete « devioblog

  2. Pingback: ASP.Net 4 Page Life Cycle « devioblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.