|
-
February 6th, 2004, 06:08 PM
#1
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|