adding user controls dynamically in asp.net
How to add user control dynamically to a asp.net webpage?
protected void addUserControl()
{
Control c = LoadControl("UserControl1.ascx");
c.ID = "uc";
this.Panel1.Controls.Add(c);
}
protected void Button1_Click(object sender, EventArgs e)
{
addUserControl();
}
References:
http://aspalliance.com/565_Dynamic_Loading_of_ASPNET_User_Controls
http://www.singingeels.com/Articles/Dynamically_Created_Controls_in_ASPNET.aspx
Happy Programming
0 Comments:
Post a Comment
<< Home