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 Responses to ASP.Net Page and Control Lifecycle

  1. […] posted about the ASP.Net page life cycle about a year ago, but recently came across this post which has a more detailed diagram on the page […]

  2. […] ASP.Net Page and Control Life Cycle […]

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 )

Google photo

You are commenting using your Google 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.

%d bloggers like this: