Tuesday, August 08, 2006

Oh No!

Done it all wrong :(

Friday, August 04, 2006

Master Pages - Event Ordering

Event Order when Master and Content Ordered
  1. Master page controls Init event.

  2. Content controls Init event.

  3. Master page Init event.

  4. Content page Init event.

  5. Content page Load event.

  6. Master page Load event.

  7. Content controls Load event.

  8. Content page PreRender event.

  9. Master page PreRender event.

  10. Master page controls PreRender event.

  11. Content controls PreRender event.


Master Pages child control Initialisation

All server controls contained within the master pages

Content page child controls Initialisation

All server controls contained within the content pages

Master Page initialisation

Page is initialised

Content Page Initialisation

Page is initialised

Content Page Load

The Page_Load event is followed by the Page_LoadComplete event

Master Page Load

The Page_Load event is followed by the Page_LoadComplete event

Master Page Child Controls load

The server controls on the master page are loaded onto the page

Content Page Child Controls load

The server controls on the content page are loaded onto the page


For Example

This is important. If you want to use control values from a master page on the content page you can't do this in the Page_Load event of the content page.

Use the Page_LoadComplete event of the content page which happens after the Page_Load event of the master page.