Forums » .NET » ASP.NET »

Which one of the following is correct regarding to ASP.NET page life-cycle stage s? Initia


Posted Date: 22 Dec 2011      Posted By:: sudhi.s.s Profile photo    Member Level: Bronze    Member Rank: 2995     Points: 4   Responses: 4



Which one of the following is correct regarding to ASP.NET page life-cycle stage
s?
Initialise,Load view state,Process postback data,Load,Send postback chan
ge notifications,Handle post
Initialise,Load,Load view state,Process postback data,Send postback chan
ge notifications,Handle post
Initialise,Load,Load view state,Process postback data,Send postback chan
ge notifications,Handle post,Post-render
None of the above




Responses

#647964    Author: madhavi      Member Level: Bronze      Member Rank: 2665     Date: 22/Dec/2011   Rating: 2 out of 52 out of 5     Points: 4

HI

Page request,Start,Initialization,Load,Postback event handling,Rendering,Unload

1) Page Request - This is the first stage, before the page life cycle starts. Whenever a page is requested, ASP.NET detects whether the page is to be requested, parsed and compiled or whether the page can be cached from the system.

2) Start - In this stage, properties such as Request and Response are set. Its also determined at this stage whether the request is a new request or old, and thus it sets the IsPostBack property in the Start stage of the page life cycle.

3) Page Initialization - Each control of the page is assigned a unique identification ID. If there are themes, they are applied. Note that during the Page Initialization stage, neither postback data is loaded, nor any viewstate data is retrieved.

4) Load - If current request is a postback, then control values are retrieved from their viewstate.
5) Validation - The validate method of the validation controls is invoked. This sets the IsValid property of the validation control.
6) PostBack Event Handling - Event handlers are invoked, in case the request is a postback.
7) Rendering - Viewstate for the page is saved. Then render method for each control is called. A textwriter writes the output of the rendering stage to the output stream of the page's Response property.
8) Unload - This is the last stage in the page life cycle stages. It is invoked when the page is completely rendered. Page properties like Respone and Request are unloaded.

each stage has its own events within it. These events may be used by developers to handle their code. Listed below are page events that are used more frequently.

Page Events:----
PreInit,Init ,InitComplete,PreLoad,Load,Control Events ,LoadComplete,
PreRender,SaveStateComplete,Render,Unload


 
#648045    Author: Kushal Zamkade      Member Level: Gold      Member Rank: 668     Date: 22/Dec/2011   Rating: 2 out of 52 out of 5     Points: 4

When the Page is requested for the first time

The Life Cycle of a page when requested for the first time:

Initializing: During this phase, the server creates an instance of the server control

Loading: During this phase, the instance of the control is loaded onto the page object in which it is defined.

PreRendering: During this phase, the control is updated with the changes made to it. This prepares the control for rendering.

Saving: During this phase, the state information of the control is saved. For example, if a value is set for the control during the Load event, it is embedded in the HTML tag that will be returned to the browser.

Rendering: During this phase, the server creates the corresponding HTML tag for the control.

Disposing: During this phase, all cleanup tasks, such as closing files and database connections opened by the control are performed.

Unloading: During this phase, all cleanup tasks, such as destroying the instances of server control are performed. This is the final event in the life cycle of a server control

With Regards
Kushal


 
#648046    Author: Kushal Zamkade      Member Level: Gold      Member Rank: 668     Date: 22/Dec/2011   Rating: 2 out of 52 out of 5     Points: 4

Life cycle when the page processed during a postback event

The processing sequence in which a page is processed during a postback event is:

Initializing: During this phase, the server creates an instance of the server control

Loading view state: During this phase, the view state of the control posted by the client is reloaded into the new instance of the control.

Loading: During this phase, the instance of the control is loaded onto the page object in which it is defined.

Loading the postback data: During this phase, the server searches any data corresponding to the control that is loaded in the data posted by the client.

PreRendering: During this phase, the control is updated with the changes made to it. This prepares the control for rendering.

Saving state: During this phase, the change in the state of control between the current request and the previous request of the page is saved. For each change, the corresponding event is raised. For example, if the text of a textbox is changed, the new text is saved and a text_change event is raised.

Rendering: During this phase, the server creates the corresponding HTML tag for the control.

Disposing: During this phase, all cleanup tasks, such as closing files and database connections opened by the control are performed.

Unloading: During this phase, all cleanup tasks, such as destroying the instances of server control are performed. This is the final event in the life cycle of a server control

The events associated with the relevant page cycle phases are:



- Page Initialization: Page_Init


- View State Loading:LoadViewState


- Postback data processing: LoadPostData


- Page Loading: Page_Load


- PostBack Change Notification: RaisePostDataChangedEvent


- PostBack Event Handling: RaisePostBackEvent


- Page Pre Rendering Phase: Page_PreRender


- View State Saving: SaveViewState


- Page Rendering: Page_Render


- Page Unloading: Page_UnLoad

With Regards
Kushal





 
#648362    Author: Pawan Awasthi        Member Level: Diamond      Member Rank: 4     Date: 25/Dec/2011   Rating: 2 out of 52 out of 5     Points: 4

Hai Sudhee,

The events occurs in the ASP.Net page life cycle, the sequence is as below:

1. Page_Init
2. LoadViewState data and post back events
3. Page_Load
4. Save post back events
5. Page_PreRender
6. SaveViewState data
7. Page_Render
8. Page_UnLoad

So the option (A) seems to be correct:

Initialise,Load view state,Process postback data,Load,Send postback change notifications,Handle post back events, Page_Prerender, Save View state data, Page_Render, page_Unload

Hope it will help you.

Regards,
Pawan Awasthi(DNS MVM)
+46 764132007
pawansoftit@gmail.com


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : What is the output of this ASP code? sub hasfun(texture) Response.Write(strReverse(Mid(uca
Previous : Ajax calendar problem
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

Priya jain
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India