Web User Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web app that uses web user controls to facilitate code reuse however
I need the controls to run in a specific order when the page is posted back.
Is there anyway to specify the order in which the controls are processed?

The page is coded in vb.net
 
By "processed" you mean the order in which they are loaded?

I believe you can do this by overriding AddParsedSubObject() on the page and
add each control to a collection you control (instead of the default page
controls collection). Then override OnInit and call a method that sorts or
arranges the controls the way you want it as it adds it to the page's
control collection.

I've done this before but not specifically to control the load order.
 
the problem I am having is with the order the controls are processed on the
post back to the server. I have a nav.ascx and a body.ascx and I need the
nav.ascx.vb to run before the bod.ascx.vb. I have tries to load the controls
in a different order with no luck the body.ascx is processed on the server
first no matter what even triggers the page post back or what order the
controls are loaded in

Thanks for you help so. let me know if you have any other ideas
 
Back
Top