Order of events: Page_Load in page and base page?

  • Thread starter Thread starter cmay
  • Start date Start date
C

cmay

Can someone advise on this issue?

We are seeing a page where, on the first load the base page (the class
our page inherits from) fires it's PageLoad event first, followed by
our Page's PageLoad.

On postback we see the reverse order taking place, with the Base Page
firing last.

Can someone tell me if this is the expected behavior? Are you not
guaranteed to have these events fire in the same order?

Thanks!!
 
events handlers tied to the same event source are called in random order. if
you need to control the order, override the OnLoad method instead of using
events, which will allow ordering.

-- bruce (sqlwork.com)
 
Back
Top