0

I have an aspx page and therein I have a dropdown control. Depending on the selected value, I need to load the user control that many times in the page. E.g..if first item is selected, I need to query DB and get how many subsections are their for this value and then load the user control that many times. It is working fine if I load the user controls in Page Load. However, If I want the view state to persist in these dynamically added user controls, I need to load them before load in Page_init event. However, when I try to do this in Page_Init, the viewstate for the dropdown has not been restored and I dont know how many usercontrols to load.

Any suggestions?.

Sugar Bowl
  • 1,626
  • 1
  • 19
  • 22
  • 1
    Have a look at this question: Dynamically added controls in Asp.Net (http://stackoverflow.com/questions/113392/dynamically-added-controls-in-asp-net) – M4N Aug 11 '11 at 21:18
  • Thanks for directing me in the rt direction. – Sugar Bowl Aug 12 '11 at 16:32

0 Answers0