PostBack Event Firing Sequence

Discussion in 'ASP .Net' started by Guadala Harry, Aug 15, 2004.

  1. Just wondering if I can count on Page_Load *always* firing before event
    procedures of other controls on the form.

    E.G., suppose I have a DropDownList server control and it is
    "autopostbacking". Will Page_Load always fire before the
    SelectedIndexChanged event of the DDL?

    Thanks.
     
    Guadala Harry, Aug 15, 2004
    #1
    1. Advertising

  2. Hi Guadala,

    The Load event will *always* fire *before* the change events, I promess :)

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    My profile: http://aspnet2.com/mvp.ashx?vga


    "Guadala Harry" <> wrote in message
    news:...
    > Just wondering if I can count on Page_Load *always* firing before event
    > procedures of other controls on the form.
    >
    > E.G., suppose I have a DropDownList server control and it is
    > "autopostbacking". Will Page_Load always fire before the
    > SelectedIndexChanged event of the DDL?
    >
    > Thanks.
    >
    >
     
    Victor Garcia Aprea [MVP], Aug 15, 2004
    #2
    1. Advertising

  3. Yes they will always be called after page_load, the order goes like this

    Page_Init
    Page_Load
    Validation
    Event Handling (your control events get fired here)
    Page_Unload

    A good read is
    http://msdn.microsoft.com/library/d...on/html/vbconWebFormsPageProcessingStages.asp

    Stephen.



    "Guadala Harry" <> wrote in message
    news:...
    > Just wondering if I can count on Page_Load *always* firing before event
    > procedures of other controls on the form.
    >
    > E.G., suppose I have a DropDownList server control and it is
    > "autopostbacking". Will Page_Load always fire before the
    > SelectedIndexChanged event of the DDL?
    >
    > Thanks.
    >
    >
     
    Stephen Woolhead, Aug 15, 2004
    #3
  4. You can place a breakpoint in your "page_load" and see what happens.
    Remember to
    configure your project to use "debug".

    Alternatively, you can "cause" an exception in you code and observe the
    order on the call stack.



    "Guadala Harry" <> wrote in message
    news:...
    > Just wondering if I can count on Page_Load *always* firing before event
    > procedures of other controls on the form.
    >
    > E.G., suppose I have a DropDownList server control and it is
    > "autopostbacking". Will Page_Load always fire before the
    > SelectedIndexChanged event of the DDL?
    >
    > Thanks.
    >
    >
     
    Bredal Jensen, Aug 15, 2004
    #4
    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. Lisa
    Replies:
    1
    Views:
    537
    Bryant Hankins
    Aug 2, 2004
  2. Phillip N Rounds

    Question re Event Firing Sequence

    Phillip N Rounds, Mar 1, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    411
    Eliyahu Goldin
    Mar 5, 2006
  3. Don
    Replies:
    1
    Views:
    278
    mr fox
    May 16, 2005
  4. tsarna

    Sort not firing PostBack event using Dynamic Columns

    tsarna, Jun 23, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    196
    tsarna
    Jun 28, 2004
  5. Lisa
    Replies:
    1
    Views:
    186
    Bryant Hankins
    Aug 2, 2004
Loading...

Share This Page