Hello all,
I have created a user control which contains 3 linkbuttons namely Add
Group,Delete Group and Add Subgroup. On ASPX page on page_load i am
calling loaduc function which loads a usercontrol by LoadControl method
and adds this usercontrol to the panel which is on page by click a Add
Group button of the ASPX page (not of button in the usercontrol). After
the first usercontrol is added the button is disabled. Next time when
adding 2nd usercontrol i click on addgroup button which is on
usercontrol so it adds the next UC. When the delete group button is
clicked the specific usercontrol should get deleted. I have done the
coding to some extent and able to add user controls. but deleting is
problem and also i need some more good efficient coding to accomplish
this task. I maintain count of how many UCs have been added till now and
loads that many UCs again on each postback on page_load of ASPX page
plus i have used eventhandler in UCs to call loaduc(),deleteuc()
functions.Thanks
Adding and persisting multiple dynamic usercontrols.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sunny SharmaRank #223 · 11.1K reputationPosted Aug 13, 2013, 11:43 PM EDT
Share your code so that we could track where if the problem is there inside your code or flow.
Thanks.
Gauri12 reputationPosted Aug 14, 2013, 1:52 AM EDT
but in that Ucs also i want to add another controls and ucs and etc.. and i think i would be very difficult to persist , keep track of what Uc added in which UC..the controls data etc..right.what do u think..