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?

    cmay, Jun 29, 2006
    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)
    bruce barker \(sqlwork.com\), Jun 30, 2006
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.