order of usercontrols processed by events of page

Discussion in 'ASP .Net Web Controls' started by Gokhan Akca, May 30, 2005.

  1. Gokhan Akca

    Gokhan Akca Guest

    I have a page containing multiple user controls.
    When Page_OnPreRender is called, the user controls' OnPreRender Method is
    called, too.

    But: How is the order of the usercontrols processed by asp.net? Note that I
    have multiple user controls - not just one.
    Assumption: the framework is accessing the page's controls list.

    If the assumption is correct:
    How can I affect the order of user controls stored in the page's controls
    list?

    Does the tag prefix registration within a page affect the order of the
    controls in the control's list?
    Or does the page parse the controls which it contains and adds them one by
    one in order of occurence within the HTML tags?


    Please note:
    I am not interested in simple page lifecycle. I am already familiar with
    page lifecycle. I need some information on how I can affect the order of web
    user controls within a page processed by asp.net events.

    Thanks.
     
    Gokhan Akca, May 30, 2005
    #1
    1. Advertising

  2. Gokhan Akca

    Brock Allen Guest

    > How can I affect the order of user controls stored in the page's
    > controls list?


    The order they're in the list is the ordered they're rendered on the page.
    Changing this order will affect the layout of your page (unless you're using
    absolute positioning).

    > I need some information on how I can affect the order
    > of web user controls within a page processed by asp.net events.


    If there's something critical you need to do on the controls in a particular
    order, I'd suggest writing code at the page level that finds all of your
    custom controls in the controls collection and then calls to them in whatever
    order you're looking for.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, May 30, 2005
    #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. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net
    Replies:
    9
    Views:
    462
    Nathan Sokalski
    May 23, 2006
  2. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    8
    Views:
    145
    Nathan Sokalski
    May 23, 2006
  3. groovq
    Replies:
    0
    Views:
    141
    groovq
    Jan 5, 2006
  4. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    8
    Views:
    160
    Nathan Sokalski
    May 23, 2006
  5. mgdev

    Web Service Requests Processed Out of Order

    mgdev, Feb 13, 2007, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    195
    John Saunders
    Feb 19, 2007
Loading...

Share This Page