Wednesday, December 22, 2010

ASP.Net Event Sequence

I have often seen developers struggle with coding due to the simple fact that they don't realize what event follows what, here is quick list of event sequence. some of the events are very rarely used and might not be so important, something like load event sequences is important and is often confused see below.

Load event Sequence
1. Content page Load event.
2. Master page Load event.   
3. Master page controls Load event.
4. Content page controls Load event.

The following is the sequence in which every events occur when a master page is merged with a content page:
  1. Content page PreInit event.
  2. Master page controls Init event.
  3. Content controls Init event.
  4. Master page Init event.
  5. Content page Init event.
  6. Content page Load event.
  7. Master page Load event.
  8. Master page controls Load event.
  9. Content page controls Load event.
  10. Content page PreRender event.
  11. Master page PreRender event.
  12. Master page controls PreRender event.
  13. Content page controls PreRender event.
  14. Master page controls Unload event.
  15. Content page controls Unload event.
  16. Master page Unload event.
  17. Content page Unload event.

kick it on

1 comment:

deweshpushkar said...

It was really very usefull.