Page Life cycle between Content page (ASPX page) and User control in ASP.net
Here I would like to introduce the page life cycle between ASPX page and User control. And it is very important of ASP.net developer to know about this.
We have an ASPX page which contains a user control.
I was trying to find the sequence of events between ASPX page and user control. Following is the diagram which helps us to understand the sequence of events between ASPX page and User control.
Consider the cycle below in clock wise direction which starts from Preinit of ASPX page and completes at unload of ASPX page.
Following are the outcomes of above diagram
1) First Preinit of ASPX is called.
2) User control does not have Preinit event
3) Unload of Usercontrol calls before the Unload of ASPX page.
Behavior of Master Page is like User control.
When I tried to find the sequence of event between Master page and ASPX page I found the same sequence of events as I explained above.
Many times we get confused that Master page is Parent page, but this is not fact.
I was trying to find the sequence of event between Master page and ASPX page (and User control and ASPX page),
then I came to know that sequence of events are same in both the cases.