Scenario 1:
Master page - Content page
Sequence of events
Content Page PreInit Event
Master Page Init Event
Content Page Init Event
Content Page Load Event
Master Page Load Event
If we are using master page and want to changes theme or decide which master page need to be load at runtime then we need to use Content page PreInit event.
Scenario 2:
Master page - Content page - Web user control on master page only.
Content Page PreInit Event
Master: UserControl Init Event
Master Page Init Event
Content Page Init Event
Content Page Load Event
Master Page Load Event
Master: UserControl Load Event
Scenario 3:
Master page - web user control on master page - Content page - Web user control on master page only.
Content Page PreInit Event
Content Page UserControl Init Event
Master:UserControl Init Event
Master Page Init Event
Content Page Init Event
Content Page Load Event
Master Page Load Event
Page:UserControl Load Event
Master:UserControl Load Event
PreRender - Page
PreRender - MasterPage
PreRender - UserControl
Unload - ChildUserControl
Unload - UserControl
Unload - MasterPage
Unload - Page
Conclusion :
1) PreInit for Content Page is first event
2) Init event sequence: UsercontrolàMaster PageàContent Page
3) Load event sequence: Content Page àMaster Pageà Usercontrol
4) Prerender event sequence is same as Load
5) Unload is exact reverse of load. Same as Init
UsercontrolàMaster PageàContent Page
6) Init and unload are same sequence
7) Load and prerender has same sequence
8) Webcontrol on content page has precedence over usercontrol in master page
No comments:
Post a Comment