This blog is moved to
http://amalhashim.wordpress.com

Tuesday, March 10, 2009

ASP.NET Page Events Lifecycle

When using master pages, the normal page event lifecycle is a little different. Here is the actual order:

  1. Page.OnPreInit
  2. MasterPageControl.OnInit (for each control on the master page)
  3. Control.OnInit (for each contol on the page)
  4. MasterPage.OnInit
  5. Page.OnInit
  6. Page.OnInitComplete
  7. Page.OnPreLoad
  8. Page.OnLoad
  9. MasterPage.OnLoad
  10. MasterPageControl.OnLoad (for each control on the master page)
  11. Control.OnLoad (for each contol on the page)
  12. Page.OnXXX (control event)
  13. MasterPage.OnBubbleEvent
  14. Page.OnBubbleEvent
  15. Page.OnLoadComplete
  16. Page.OnPreRender
  17. MasterPage.OnPreRender
  18. MasterPageControl.OnPreRender (for each control on the master page)
  19. Control.OnPreRender (for each contol on the page)
  20. Page.OnPreRenderComplete
  21. MasterPageControl.SaveControlState (for each control on the master page)
  22. Control.SaveControlState (for each contol on the page)
  23. Page.SaveViewState
  24. Page.SavePageStateToPersistenceMedium
  25. Page.OnSaveStateComplete
  26. MasterPageControl.OnUnload (for each control on the master page)
  27. Control.OnUnload (for each contol on the page)
  28. MasterPage.OnUnload
  29. Page.OnUnload

1 comment:

Muhammad Azeem said...

This is a nice article..
Its easy to understand ..
And this article is using to learn something about it..

c#, dot.net, php tutorial, Ms sql server

Thanks a lot..!
ri70