Page_Load happens always before postback events. And other way around,
postback events raised by controls are raised always after Page_Load.
With State of variables : if you mean local variables / members on the Page
they do not keep their state by default (Page class is recreated for every
request), however those which utilize ViewState (controls itself do), they
do keep their state and are restored to the state (from previous
postback/request by the same user) before Pgae_Load (actually right after
In case you are interested in the Page lifecycle (the phases during one
4. LoadViewState (postback)
5. Load postback data (postback, IPostBackDatahandler.LoadPostdata)
7. Load postback data for dynamical controls added on Page_Load (postback)
8. Raise Changed Events (postback,
9. Raise postback event (postback, IPostBackEventHandler.RaisePostBackEvent)
ASP.NET 2.0 has added a support for a few more stages. Here's a nice diagram
of all the relevant phases in v2
ASP.NET MVP, AspInsider
"cj" <cjohnsonwcc.qld.edu.au> wrote in message
news:428182f1$0$266$61c65585uq-127creek-reader-03.brisbane.pipenetworks.com.au...>I am using datagrids with buttoncolumn etc. I am trying to understand the
>order of events.
> If a user clicks on a ButtonColumn button, what is the order of events
> after that? Does the event-handler subroutine happen before the Page_Load
> subrouting, or the other way around?
> Also, I assume the state of any variables etc will be updated before
> either Page_Load or event handler subroutines?
> Can someone please clarify this?