Page Life Cycle
Page Life Cycle
Initialization
PreInit
Init
Init Complete
Load
Load Complete 3 Post Back Events Rendering Pre Render SaveStateComplete Render
Unload
The entry point of the page life cycle. Programmatic access to master pages and themes is allowed. Can dynamically set the values of master pages and themes & also dynamically create controls in this event. This event fires after each control has been initialized, each control's UniqueID is set and any skin settings have been applied. Can use this event to change initialization values for controls. Raised once all initializations of the page and its controls have been completed. Till now the viewstate values are not yet loaded, hence you can use this event to make changes to view state Raised after the page loads view state for itself and all controls, and after it processes postback data that is included with the Request instance Code inside the page load event typically checks for PostBack and then sets control properties appropriately. This is the first place in the page lifecycle that all values are restored. You can also create dynamic controls in this method. This event signals the end of Load. ASP.NET now calls any events on the page or its controls that caused the PostBack to occur. This might be a buttons click event or a dropdown's selectedindexchange event. Allows final changes to the page or its control. This event takes place before saving ViewState, so any changes made here are saved. Prior to this event the view state for the page and its controls is set. Any changes to the pages controls at this point or beyond are ignored. The Render method generates the client-side HTML, Dynamic Hypertext Markup Language (DHTML), and script that are necessary to properly display a control at the browser. This event is used for cleanup code. After the page's HTML is rendered, the objects are disposed of. At this point, all processing has occurred and it is safe to dispose of any remaining objects, including the Page object