http://msdn.microsoft.com/en-us/library/dct97kc3.aspx
http://msdn.microsoft.com/en-us/library/ms178472.aspx
The following is the sequence in which events occur when a master page is merged with a content page:
-
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.
The sequence of events in master and content pages rarely is important for you as page developer. However, if you are creating event handlers that depend on the availability of certain controls, you will find it helpful to understand the event sequence in master and content pages.

Note: Some Terms Explanation
PreRender:Use the event to make final changes to the contents of the page or its controls before the rendering stage begins.
Render: This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup to send to the browser.
Unload:
Raised for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.
84




被折叠的 条评论
为什么被折叠?



