When a page is posted back, which statement runs after page_load is done executing? Without knowing what controls are in the page. This is in VS 2008 debugger.
EDIT: The question is about knowing which event and for which control comes next.
When a page is posted back, which statement runs after page_load is done executing? Without knowing what controls are in the page. This is in VS 2008 debugger.
EDIT: The question is about knowing which event and for which control comes next.
- PreInit
- Init
- InitComplete
- PreLoad
- Load
- Control Events (e.g. ButtonClick)
- LoadComplete
- PreRender
- SaveStateComplete
- Render
- Unload
The "next statement" is indeterminate. To put it another way, in the sense of "separation of concerns", it's none of your concern. It's the concern of ASP.NET, but not of individual controls on a page, nor of individual developers debugging a page.
I recommend that you determine what question you really needed answered, and what problem you really needed solved.
Here's an example of "why not": Consider the DataBinding
event, which is raised when the Control.DataBind
method is called, often from inside of Page_Load
. Consider a page that contains a DataGrid
control. When Control.DataBind
is called, the DataBinding
event is raised for the control, and Control.DataBind
is then called on each control in Control.Controls
, eventually causing DataBinding
to be raised for those controls. When it gets to the DataGrid
, the control will populate its Controls
collection with one row for each row in the input data.
Each of the added controls will need to "catch up". They will go through the PreInit
, Init
, Load
, etc. phases - everything up to DataBind
.
There's no way to know ahead of time which controls will be added, so you certainly can't determine which events will be fired, and in which order. In fact, some of the control events will fire or not depending on the previous state of the controls. A SelectedIndexChanged
event on a dropdown control in a template column of one of the rows may fire if the dropdown index has changed from the last postback, but not if it has stayed the same!
You need to get a copy of the ASP.NET runtime .pdbs if you want to debug the ASP.NET runtime, good luck. :)