Gauri

Gauri

  • NA
  • 12
  • 16.6k

adding and persisting multiple dynamic usercontrols.

Aug 14 2013 2:30 AM
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

Answers (2)