Translate

Wednesday, September 14, 2011

Asp.net page events with usercontrol and master page



We come across this situation many times where we have a page that has a master page and a user control inside that page. In situations like this it really helps to know in which order the page events execute. Given below is the order of execution of page events in such a scenario.

Sequence Number
Page
Event name
1
Aspx page
Page_PreInit

2
User Control
Page_Init
3
Aspx page
Page_Init

4
Aspx Page
Page_InitComplete

5
Aspx Page
Page_PreLoad

6
Aspx Page
Page_Load
7
Master Page
Page_Load
8
User Control
Page_Load

9
Control events (button click, dropdown index change etc)
10
Aspx Page
Page_LoadComplete

11
Aspx Page
Page_PreRender
12
Master Page
Page_PreRender
13
User Control
Page_PreRender

14
Aspx Page
Page_PreRenderComplete

15
Aspx Page
Page_SaveStateComplete

16
User Control
Page_Unload
17
Master Page
Page_Unload
18
Aspx Page
Page_Unload

No comments:

Post a Comment

Comments will appear once they have been approved by the moderator