hi I like to add Dynamically add WebUser Controls in a loop
like this con1 con2 con3 and more or less depending on the loop
is there a good way to do this
my first try look like this. but i don't know how to tell it to use the next one grpCon2
foreach (DataRow Group in AllGroups.Rows)
{
GroupListControl grpCon1 = new GroupListControl();
grpCon1.NickName = "STUFF";
grpCon1.GroupName = "HARD";
LiteralAddCOntrols.Text = @"<uc1:GroupListControl ID=""GrpCOn1"" runat=""server"" />";
}
You need to use loadcontrol(pathtoyourusercontrol), and then and the control back to your page at the location you want.
Add :
To the page aspx loading the control and you will be able to use a typed reference to it.