0% found this document useful (0 votes)
18 views

Page Life Cycle

The document describes the page lifecycle in ASP.NET. It begins with initialization events like PreInit and Init where programmatic access to master pages and themes is allowed. Next is the load events like Load and LoadComplete where viewstate is loaded and postback data is processed. Then rendering events like Render and SaveStateComplete occur where the HTML is generated. Finally unload events like Unload cleanup and dispose of objects.

Uploaded by

satya2328
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Page Life Cycle

The document describes the page lifecycle in ASP.NET. It begins with initialization events like PreInit and Init where programmatic access to master pages and themes is allowed. Next is the load events like Load and LoadComplete where viewstate is loaded and postback data is processed. Then rendering events like Render and SaveStateComplete occur where the HTML is generated. Finally unload events like Unload cleanup and dispose of objects.

Uploaded by

satya2328
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1

Initialization

PreInit

Init

Init Complete

Load

Pre load 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

Asp.Net Page Life Cycle

You might also like