Hi,
Q) In an interview i was asked to tell about page life cycle of a page in asp.net.
A) My answer is like When the user give the url in the browser asp.net engine in iis server takes the request and checks wheather it is a new request or a post back request. If it is a postback request then the cached response is sent back to the user, if it is a new request then the page objects like request and response objects will be created. Then i told about Init, Load, Validation, EventHandling, Render stages. The interviewer is not satisfied with my answer.
Please help me how should i give answer for this?
Loading
Vithal WadjePosted Mar 26, 2015, 2:28 PM
Start
Init
Load
validation
event
Render
following is the whole sequence
Anurag SarkarPosted Mar 26, 2015, 1:15 PM
You tried your best. But i think he was expecting more clear view for that please check this out.
http://www.codeproject.com/Articles/667308/ASP-NET-Page-Life-Cycle-Events
Thanks
Pankaj Kumar ChoudharyPosted Mar 26, 2015, 12:22 PM
when a asp.net application( page ) is run then page goes through a life cycle and performs a series of task in each step like: initialize controls, initialize page , maintain state, rendering , run event handlers code.
in a complete page life cycle a pages goes through following steps.
Preinit,Init,Init complete , Onpreload,Load, Control post back, load complete, prerender, prerender complete, onsavestate complete , Rendor method,Unload.
in your answer you said that "If it is a postback request then the cached response is sent back to the user, if it is a new request then the page objects like request and response objects will be created. Then i told about Init, Load, Validation, EventHandling, Render stages. The interviewer is not satisfied with my answer. "
all these events are also occur if the request is Post back (except some steps) not only for new request.
In your answer you maintain that it is occur only if It is new request.
I think due to this reason interviewer did not satisfied........