Leah
4Penny.net
Points: 7316

8/13/2020 9:05:39 AM

Dynamic (Programmatic) ASP.NET Nested User Controls

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

This article will detail how to dynamically add nested user controls (ascx pages) to a standard web page. 

In other words:

StandardPage.aspx
>> ucChild.ascx (added as a standard control)
>>>> ucGrandChild (added dynamically from code behind)
>>>> ucGrandChild2 (added dynamically from code behind)

We needed to add the GrandChildren user control 0 to many times, so the dynamic (programmatic) approach was important

As usual, I'm going to post this code as tersely as possible, but if you have a question please just ask in the comments. 

The result will look like this:

4Penny.net
Version: Unknown or N/A
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3