Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > order of Event Handling and Posting Page_Load..?

Reply
Thread Tools

order of Event Handling and Posting Page_Load..?

 
 
cj
Guest
Posts: n/a
 
      05-11-2005
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?

Thanks

cj


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      05-13-2005
Hi,

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
Page_Init)

In case you are interested in the Page lifecycle (the phases during one
request).

ASP.NET 1.0/1.1

1. Instantiate
2. Initialize
3. TrackViewState
4. LoadViewState (postback)
5. Load postback data (postback, IPostBackDatahandler.LoadPostdata)
6. Load
7. Load postback data for dynamical controls added on Page_Load (postback)
8. Raise Changed Events (postback,
IPostBackDatahandler.RaisePostDataChanged)
9. Raise postback event (postback, IPostBackEventHandler.RaisePostBackEvent)
10.PreRender
11. SaveViewState
12. Render
13. Unload
14. Dispose

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

http://hydrate.typepad.com/leo/2004/...pnet_v20_.html

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU


"cj" <(E-Mail Removed)> wrote in message
news:428182f1$0$266$(E-Mail Removed)...
>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?
>
> Thanks
>
> cj
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Posting Fails in Medium Trust (3rd time posting this w/ zero replies so far) AmitKu ASP .Net 7 01-08-2007 07:31 PM
Top Posting vs. Bottom Posting scaredkitty Computer Support 37 04-06-2005 12:27 AM
Event posting and handling in all classes? Kaidi Java 1 11-05-2004 10:12 AM
Everytime I hover cursro over a posting, it crosses out with red mark on it.. on every posting alanb ASP .Net 2 04-23-2004 02:23 PM
Event order handling Xela ASP .Net 2 08-25-2003 08:46 AM



Advertisments