I know the Page Life cycle Events while requesting the Page for the first time.
What are the events fired while Page is Post Back.
I know the Page Life cycle Events while requesting the Page for the first time.
What are the events fired while Page is Post Back.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rohti AmbaniPosted Oct 11, 2008, 2:45 AM
Niradhip ChakrabortyPosted Oct 10, 2008, 5:03 PM
Here are the events (and the order) that are raised when a Button is clicked and a postback occurs:
1.Page.Init + Control.Init for every control on the Web Form
The first stage in the page life cycle is initialization. After the page's control tree is populated with all the statically declared controls in the .aspx source the Init event is fired. First, the Init event for the Page object occurs, then Init event occurs for each control on the Page. Viewstate information is not available at this stage.
2.Page.LoadViewState
After initialization, ASP.NET loads the view state for the page. ViewState contains the state of the controls the last time the page was processed on the server.
3.Page.ProcessPostData
Post Data gets read from the request and control values are applied to control initalized in stage 1.
4.Page.Load + Control.Load for each control on the Page
If this is the first time the page is being processed (Page.IsPostback property), initial data binding is performed here.
5."Change" events are fired for controls (TextChanged, SelectedIndexChanged, and similar)
The current value (from Post Data) is compared to the original value located in the ViewState. If there is a difference "Changed" events are raised.
6.Server-side events are fired for any validation controls
7.Button.Click + Button.Command
The Click and Command events are fired for the button that caused the postback
8.Page.PreRender + Control.PreRender
9.Page.SaveViewState
New values for all the controls are saved to the view state for another round-trip to the server.
10.Page.Render