Page LifeCycle steps in ASP.net...?
In this Article I'm trying to explain the Page Lifecycle in Framework. Here this is small description how to call the page in application which event is raised first and etc ... There are several events raised while loadig page we discuss all that event..
Page Life Cycle:
Page/Control processing first request:
• PreInit/ Init:
Before constructing the control PreInIt then each control Instantiated set to Innitial state Added to Control State.
• Load:
User Code runs, tests it's postback conditions to databind first value.
• PreRender:
Creat Child Controls, ensure contros are ready to render.
• Save ViewState:
Controls save current state (if different than innitital values)
• Render:
Each control Render itself to the Response.
• Dispose:
Page and all controls are destroyed.Page / Controls Processing PostBack( Advanced ):
• InIt:
Before constructing the control PreInIt then each control Instantiated set to Innitial state Added to Control State.
• LoadViewState:
Lost state of the controls restored from viewstate values.
• Load:
User Code runs, tests it's postback conditions to databind first value.
• PostBack Data:
Posted Data is passed to its associated controls.
• PostBack Events:
Events are fixed for controls in tree order, except the event that caused the post it's fired last.
• Pre Render:
Creat Child Controls, ensure contros are ready to render.
• Save ViewState:
Controls save current state (if different than innitital values)
• Render:
Each control Render itself to the Response.
• Dispose:
Page and all controls are destroyed.
The basic steps of the ASP.NET page life cycle as below.
Start :- :-where We can set page properties such as Request, Response, IsPostBack and UICulture etc.
Page Initialization:-We have access to the Init, InitComplete and PreLoad methods in this stage
Load :-The OnLoad is the event method that fires during this stage
Validation :- You can now check the IsValid property of the control
Event handling : :- The event handling controls occurs for server like Click, SelectedIndexChanged, etc
Rendering :- This Stage we can create custom controls to override the Render method for the control
Unload :- this Stage is final event occurs first for each control