Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding multiple user controls in a page

Status
Not open for further replies.

dazza12345

Programmer
Nov 25, 2005
35
GB
Hi all, jst a quick question about how i would go about adding multiple user controls onto a page, depending on the number selected in a drop down list.

i have a drop down list called NumberofChildren. From the selection (i.e. 2), I would like to add 2 child user controls (Child.ascx) onto my .aspx page.

How would i go abouts altering this code (which outputs only 1 child user control) to output as many as the user tells it to:

Code:
<uc2:Child ID="Child1" runat="server" />

Cheers
 
Use a Panel or a PlaceHolder and then use the LoadControl method to load as many user controls as you need (and then just add the to the Panel/PlaceHolder).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top