Events in Master & Content Pages
Posted by CJ on November 13, 2006
I was asked a question today while teaching an ASP.NET course about the sequence of events between a Master page and Content page, and if they both have the same event (say a Page_Load) then which one fires first.
I found the following information on msdn and more.
The following is the sequence in which events occur when a master page is merged with a content page:
Master page controls Init event.
Content controls Init event.
Master page Init event.
Content page Init event.
Content page Load event.
Master page Load event.
Content controls Load event.
Content page PreRender event.
Master page PreRender event.
Master page controls PreRender event.
Content controls PreRender event.
Mick said
CJ – dont forget about the pre-inits as well.
To set themes of the page etc.