asp.net 1.1 page and controls life-cycle

Discussion in 'ASP .Net' started by Fred, Jan 20, 2006.

  1. Fred

    Fred Guest

    hi, i have a page written by someone else w/ a few user controls inside
    it(w/ user controls inside em too) - what i dont get is the order
    different page_inits, page_loads, cashed and postback events and code
    inside <% %> are executing

    can u plz point me to a specification or some other description of the
    whole process

    TIA
     
    Fred, Jan 20, 2006
    #1
    1. Advertising

  2. http://aspalliance.com/articleViewer.aspx?aId=134&pId=

    init
    load viewstate (if postback)
    Process posted data (if postback)
    Page Load
    Process posted data again (if postback, necessary incase things changed in
    page_load)
    Raise events (if postback)
    Prerender
    Save viewstate
    Unload

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Fred" <> wrote in message
    news:...
    > hi, i have a page written by someone else w/ a few user controls inside
    > it(w/ user controls inside em too) - what i dont get is the order
    > different page_inits, page_loads, cashed and postback events and code
    > inside <% %> are executing
    >
    > can u plz point me to a specification or some other description of the
    > whole process
    >
    > TIA
     
    Karl Seguin [MVP], Jan 20, 2006
    #2
    1. Advertising

  3. Fred

    Fred Guest

    tnx for this info, Karl

    but what happens when u have controls inside page, when are their events
    processed, code inside .aspx pages and <%= %> tag, dynamicly added controls

    Karl Seguin [MVP] wrote:
    > http://aspalliance.com/articleViewer.aspx?aId=134&pId=
    >
    > init
    > load viewstate (if postback)
    > Process posted data (if postback)
    > Page Load
    > Process posted data again (if postback, necessary incase things changed in
    > page_load)
    > Raise events (if postback)
    > Prerender
    > Save viewstate
    > Unload
    >
    > Karl
    >
     
    Fred, Jan 20, 2006
    #3
  4. Events are recursive. If Page_Load fires in the page, then in the child
    control, then in controls within the control.

    <%= %> happens sometime after prerender

    dynamically added controls play catch up when they are added to the page. If
    they are added in Init, then init will fire. if they are added during
    page_load, then init and page_load will fire...


    Karl
    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Fred" <> wrote in message
    news:...
    > tnx for this info, Karl
    >
    > but what happens when u have controls inside page, when are their events
    > processed, code inside .aspx pages and <%= %> tag, dynamicly added
    > controls
    >
    > Karl Seguin [MVP] wrote:
    >> http://aspalliance.com/articleViewer.aspx?aId=134&pId=
    >>
    >> init
    >> load viewstate (if postback)
    >> Process posted data (if postback)
    >> Page Load
    >> Process posted data again (if postback, necessary incase things changed
    >> in page_load)
    >> Raise events (if postback)
    >> Prerender
    >> Save viewstate
    >> Unload
    >>
    >> Karl
    >>
     
    Karl Seguin [MVP], Jan 20, 2006
    #4
  5. Fred

    Fred Guest

    great, IMHO you should write an article w/ this information

    one last detail when are 'script runat=server' blocks in .aspx pages
    executed - again after PreRender ?

    Karl Seguin [MVP] wrote:
    > Events are recursive. If Page_Load fires in the page, then in the child
    > control, then in controls within the control.
    >
    > <%= %> happens sometime after prerender
    >
    > dynamically added controls play catch up when they are added to the page. If
    > they are added in Init, then init will fire. if they are added during
    > page_load, then init and page_load will fire...
    >
    >
    > Karl
     
    Fred, Jan 20, 2006
    #5
  6. Well, if I recall, you can't just do:

    <script runat="server">
    Response.Write("aa");
    </script>

    ur runat="server" needs to have hooks into the actual methods. so the
    <script runat="server"> Page_Load</script> is the same event as the
    codebehind one.

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Fred" <> wrote in message
    news:...
    > great, IMHO you should write an article w/ this information
    >
    > one last detail when are 'script runat=server' blocks in .aspx pages
    > executed - again after PreRender ?
    >
    > Karl Seguin [MVP] wrote:
    >> Events are recursive. If Page_Load fires in the page, then in the child
    >> control, then in controls within the control.
    >>
    >> <%= %> happens sometime after prerender
    >>
    >> dynamically added controls play catch up when they are added to the page.
    >> If they are added in Init, then init will fire. if they are added during
    >> page_load, then init and page_load will fire...
    >>
    >>
    >> Karl
     
    Karl Seguin [MVP], Jan 23, 2006
    #6
    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. Guest
    Replies:
    3
    Views:
    2,817
    Bruce Barker
    Sep 6, 2005
  2. HP
    Replies:
    3
    Views:
    611
  3. =?Utf-8?B?U2FtZWVrc2hh?=

    HTTP Post and ASP.Net application life cycle

    =?Utf-8?B?U2FtZWVrc2hh?=, Jul 18, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    515
    =?Utf-8?B?TWFuaXNoIEJhZm5h?=
    Jul 18, 2007
  4. lander
    Replies:
    5
    Views:
    2,587
    Mark Rae [MVP]
    Mar 3, 2008
  5. Gary Larimer

    Page life cycle and Page.IsValid property

    Gary Larimer, Jul 30, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    403
    Gary Larimer
    Aug 1, 2008
Loading...

Share This Page