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. Advertising

  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. Advertising

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,211
    nfedin
    Feb 23, 2004
  2. 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:
    922
    Ignacio Machin \( .NET/ C# MVP \)
    Sep 2, 2004
  3. z. f.
    Replies:
    0
    Views:
    588
    z. f.
    Oct 19, 2004
  4. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    order of events - dynamic checkbox events

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Aug 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    595
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Aug 17, 2005
  5. =?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:
    302
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Apr 15, 2007
Loading...

Share This Page