We help IT Professionals succeed at work.

Control Order of ascx Render

Silas2
Silas2 asked
on
Medium Priority
1,280 Views
Last Modified: 2012-05-06
I don't know why it's taken me so long to come across this problem, but I can't seem to find any help on it, but when you have multiple ascx's on an aspx page, how do you know the order they process/render in?
(important if one control relies on the output of another)
The order within the design-time markup doesn't seem to make any difference.
I can find stuff on aspx vs ascx, but nothing ascx/ascx
Comment
Watch Question

It depends on the Page Life cycle.  Refer below.
        http://msdn.microsoft.com/en-us/library/ms178472.aspx
Instead of adding the controls to your aspx page, keep a placeholder for each control and add it dynamically doing the Page_Load in a specified order.  This will ensure that the controls events fire are the same order you are adding.
Refer, below to add controls dynamically to page
       http://aspalliance.com/565_Dynamic_Loading_of_ASPNET_User_Controls

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.