Order of events: Page_Load in page and base page?

Discussion in 'ASP .Net' started by cmay, Jun 29, 2006.

  1. cmay

    cmay Guest

    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!!
     
    cmay, Jun 29, 2006
    #1
    1. Advertisements

  2. 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)



    "cmay" <> wrote in message
    news:...
    > 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!!
    >
     
    bruce barker \(sqlwork.com\), Jun 30, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bminder
    Replies:
    1
    Views:
    2,356
    nfedin
    Feb 23, 2004
  2. Skating_vince
    Replies:
    2
    Views:
    476
    Skating_vince
    Aug 13, 2004
  3. Ignacio Machin \( .NET/ C#  MVP \)

    order of execution of page_load in a base and derived classes

    Ignacio Machin \( .NET/ C# MVP \), Sep 1, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    1,073
    Ignacio Machin \( .NET/ C# MVP \)
    Sep 2, 2004
  4. z. f.
    Replies:
    0
    Views:
    719
    z. f.
    Oct 19, 2004
  5. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    order of events - dynamic checkbox events

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Aug 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    759
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Aug 17, 2005
  6. rockdale
    Replies:
    1
    Views:
    880
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
  7. =?Utf-8?B?TWlrZXkgQmFieQ==?=

    ObjectDataSource_Load and Page_Load events - What Order?

    =?Utf-8?B?TWlrZXkgQmFieQ==?=, Apr 15, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    348
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Apr 15, 2007
  8. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    635
    Chris
    Aug 30, 2005
Loading...