您的位置:首页 > 编程语言 > ASP

Events in ASP.NET Master and Content Pages

2011-11-20 22:11 971 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: