Posted on: 5/15/2013 3:57:39 AM | Views : 203

Hi, I am trying to add a new usercontrol right below the previously added one with a button click, but it doesn't work, only one UC is added at a time, I tried a loop add and it works but not on button clicks. Can someone please kindly advice. Thanks.
protected void btnAddWhatsNew_Click(object sender, EventArgs e) { WhatsNew whatsNew = LoadControl("UserControls/WhatsNew.ascx") as WhatsNew; if (whatsNew != null) { whatsNew.ID = DateTime.Now.ToShortTimeString(); whatsNew.ImgURL = "/Images/Images.jpg"; plcHldWhatsNew.Controls.Add(whatsNew); } }
...

Go to the complete details ...