Incrementally create user controls
Hi,
I would appreciate if you could help me with my source code.
I want to create web user controls dynamically each time i press the button.
But i only get one control each time. If i use a 'for'-loop then it is no problem.
public Control c1;
private void Button1_Click(object sender, System.EventArgs e)
{
c1 = LoadControl("WebUserControl1.ascx");
((WebUserControl1)c1).Color="green";
FindControl("WebForm1").Controls.Add(c1);
FindControl("WebForm1").Controls.Add(new HtmlGenericControl("hr"));
}
Yours sincerely
Andla