Life cycle of an ASP.NET web page has a series of events. We handle the appropriate events to plug in the required code for developing the web page. If we use Master-Content web pages of ASP.NET v2.0, it is important to understand the order in which the events of Master-Content pages are raised.
Till today I was in the assumption that events of Master page are raised before the Content page events are raised. But it is not true for all the events. For example Page Load of Content page is raised before Master pages Page Load event.
Here is the sequence in the which the events of Master-Content pages are executed
- Content page PreInit event.
- 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.
- Master page controls Load event.
- Content page controls Load event.
- Content page PreRender event.
- Master page PreRender event.
- Master page controls PreRender event.
- Content page controls PreRender event.
- Master page controls Unload event.
- Content page controls Unload event.
- Master page Unload event.
- Content page Unload event.
Happy programming!
What about Page_LoadComplete? Where does it fit in after page load or controls load?