5
Answers

Page life cycle

Akshay Teotia

Akshay Teotia

13y
4.5k
1
Hi friend

When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps then i want to know which event is occar on post ,post back and on both.
Answers (5)
0
Anuja Pawar
NA 1.7k 105k 13y
0
Akshay Teotia
NA 3.8k 3.7m 13y
thanks pankaj,vijay and vneet actually i want to know that every time page is post to server and post back from server then in both case which event is occur for example view state (page load) is maintain in both post and post back .
0
Vineet Kumar Saini
NA 10.7k 4.2m 13y
General Page Life-cycle Stages
====================

Page request
:- The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled or whether a cached version of the page can be sent in response without running the page.

Start :- In the start step, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. Additionally, during the start step, the page's UICulture property is set.

Page initialization :-During page initialization, controls on the page are available and each control's UniqueID property is set. Any themes are also applied to the page. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.

Load :- During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.

Validation :-During validation, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.

Postback event handling :- If the request is a postback, any event handlers are called.

Rendering :-
Before rendering, view state is saved for the page and all controls. During the rendering phase, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property.

Unload :- Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and any cleanup is performed.
0
Vijay Yadav
NA 1.7k 537.9k 13y
Akshay, see our recommended articles on the right hand side.
0
Pankaj Rana
NA 671 243.8k 13y
Refer tot this link http://msdn.microsoft.com/en-us/library/ms178472.aspx