Asp.net Web Form Application Page life Cycle
Page life cycles is called how different Events are processed of Web Form page
There are mainly eight Steps of Page life cycle
- Page Request
- Start
- Page Initialization
- Page Load
- Page Validation
- Post Back Event Handling
- Rendering
- Un Load
Page Request : -
When the Page is requested by the User to the Server then the compiling is determined by Asp.net
Start : -
In this stage Page Properties are set. In Asp.net Page is an object with properties
Page Initialization : -
In this stage page control became available and themes are applied
- Page_PreInit()
Page Properties became Available like
Page.IsPostBack
bool isPostBack=Page.IsPostBack
But at this stage if the form is submitted than you will get the null values for Form fields
2. Page_Init() — You can set Label Value
Label1.Text
3. Page_InitComplete() — Every thing has been initialized this event can be used for task that needs first to be initialized
Page Load :-
In this stage Form Values are Available after Submission
- Page_PreLoad()
- Page_Load()
- Page_LoadComplete()
Page Validation : -
In this step page Validation is applied.
Post Back Event : -
After Form is submitted then this Stage is set to be true
Rendering : -
View State is Saved for the Page (html)
Un Load : -
Page Properties are Unloaded if you want to change some Label or Control values after all the functionality is done then you can achieve in this stage.