explain about page life cycle in Asp.net
Kranthi Kumar Verroju
Hi.. ASP.Net webpage execution will perform several steps for processing page, this is called asp.net page life cycle. the steps are 1)preInit 2)Init 3)preload 4)Load 5)PreRender 6)Render 7)Unload
Hi..ASP.Net webpage execution will perform several steps for processing page, this is called asp.net page life cycle. the steps are1) Page Request2)Start3)Page initialization4)Page Load5)Post Back events execution6)Rendering7)Unload
1. OnInit (Init) -- Inializes all Child controls on the Page
2. LoadControlState -- Loads the Control State
3. LoadViewState -- Loads the View State
4. LoadPostData -- Control properties are set according to the received form data
5. Load -- Actions can be performed on the controls as all the pre-activities are complete by this time
6. RaisePostDataChangedEvent -- This event is raised if data has been changed in previous and Current Postbacks.
7. RaisePostBackEvent -- This event handles the user action that caused the Postback.
8. PreRender (OnPreRender) -- This event takes place between postback and saving viewstate. Till this stage changes will be saved to the control.
9. SaveControlState -- Self Explanatory
10. SaveViewState -- Self Explanatory
11. Render -- Generates artifacts at Client side (HTML,DHTML,Scripts) to properly display controls
12. Dispose -- Releases unmanaged Resource ( Database connections, file handles)
13. Unload -- Releases managed Resources ( Instances created by CLR)
While excuting the page, it will go under the fallowing steps(or fires the events) which collectivly known as Page Life cycle.
Page_Init -- Page InitializationLoadViewState -- View State LoadingLoadPostData -- Postback data processingPage_Load -- Page LoadingRaisePostDataChangedEvent -- PostBack Change NotificationRaisePostBackEvent -- PostBack Event HandlingPage_PreRender -- Page Pre Rendering PhaseSaveViewState -- View State SavingPage_Render -- Page Rendering Page_UnLoad -- Page Unloading