Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Controls / May 2005

Tip: Looking for answers? Try searching our database.

order of usercontrols processed by events of page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gokhan Akca - 30 May 2005 10:17 GMT
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.
Brock Allen - 30 May 2005 15:07 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.