C#
C#
loaded into the server memory which is then proceed, and send to the browser as response.
At each state, method and events are available which can be over rided to full fill requirement of
application. These stages include initialization, instating, control and restoring and managing ,
running event handle port running the page server.
1)pre-init:-when page lifecycle starts, pre init pre event occur before next init stage begin. This event
use to perform the following tasks.
(a)check IsPostBack property to state whether this is first time page in being is proceed and
determin whether the postback.
Init event has individual event occur before init event of page.
This event can be use to initialize to control property. This event handled by over loading the OnInIt
method. Or by creating a page _init handler.
It tracking of view
If tracking of view state is turn off any values added to view step are lost during postback.
Pre load:- this event is occur after page load. Its view state and repeatedly load view state
Rising to this event to n view state for itself and all control on the page and process postback data
contain by the request instane.
Load:- load event is occur for page and then recursively for all child control.
To handle this event on page object is called to repeat saying all the child control the page.
Load event of page is followed by load event of individual control. This event is useful for setting
properties of controls of page and to connect with database.
Control event :- when web page completely loaded or validated ASP.NET fires all the event which are
occur due to the last postback. ASP.NET has two types.
(a)imidiate response event :- this event clicking on submit button or some other button.
(b)initiate event :- this event include selected the web control that is check box radio button or
textbox.
For web control if AutoPostBack property to otherwise control.next time postback.
End of the event handling stage its sue for task that need all the web control of page are loaded.
Pre render:- pre output is pre render. During pre render state instance are available. So last minite
action stopring additional information in viewstate is done.
Page object occur pre renders event and then web control and page this event is use to final change
To contain of pages or its control before page is rerender. As pre render event are occur repeatedly
for all controls on the page. This event garanty the completion pre rendering the phase . this event
occur before DataBind() for all control is for.
Save state complete. This event is occur when control state and viewstate information is save. Any
changes to page web control on that page affect rendering of the page but changes are not reviewed
next postback.
The next page render:- at the end of the life cycle it is render to html. At this stage of lifecycle page
call for all web controls. Each web control invoke render method. Which create markup of control to
be send to browser.
Last one is unload phase is last page. Is occur for all web control is repeatedly final clean up such as
closing files stream is done all the resources refrences are free this event can be handled by using
the OnUnLoad() at this stage page object still available but , final html is already render and cannot
change.