MaterPage中事件的觸發順序

When you work with master pages and content pages, both can use the same events (such as Page_Load).
Be sure you know which events come before others. You are bringing two classes together to create a single
page class, and a specific order is required. When an end user requests a content page in the browser,
the event ordering is the following:
❑Master page child controls initialization: All server controls contained within the master page
are first initialized.
❑ Content page child controls initialization: All server controls contained in the content page are
initialized.
❑ Master page initialization: The master page itself is initialized.
❑ Content page initialization: The content page is initialized.
❑ Content page load: The content page is loaded (this is the Page_Load event followed by the
Page_LoadComplete event).
❑ Master page load: The master page is loaded (this is also the Page_Load event followed by the
Page_LoadComplete event).
❑ Master page child controls load: The server controls on the master page are loaded onto
the page.
❑ Content page child controls load: The server controls on the content page are loaded onto
the page.

1、Master頁面中的控件初始化:所有包含在Master頁面中的服務器端控件首先被初始化;
2、Content頁面中的控件初始化:所有包含在Content頁面中的服務器控件緊接着被初始化;
3、Master頁面初始化:Master頁面本身初始化;
4、Content頁面初始化:Contetn頁面本身初始化;
5、載入Content頁面:content頁面被載入() 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章