2

I have to dynamically add many AJAX CascadingDropDown control sets (with different data). The data is to be read from a database. Can this approach be use for dynamic creation? Would it be better to have a Web User Control that can be added dynamically. I don't get a clear picture of how to implement this. Any suggestions/hints on the best way to go about would be very helpful.

Item 1: Company | Product | Model
Item 2: Company | Product | Model
..
Item n: Company | Product | Model
Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
Nemo
  • 24,540
  • 12
  • 45
  • 61
  • You can do it programtically using Custom UserControls, where you will have to be careful is recreating the controls on every postback and ensure the ViewState does not become corrupted. – Lloyd Feb 20 '12 at 00:26

2 Answers2

0

If you are trying to dynamically load in the sense that you don't know the control until runtime, you can make a asp:placeholder and then call a function that creates the control as desired , then use placeholdername.Controls.Add(newdropdown). You can do this via Ajax though I would also recommend the Telerik library as their Ajax Control makes this click and point easy.

done_merson
  • 2,800
  • 2
  • 22
  • 30
0

I suggest you start checking this toolkit: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx

enricoariel
  • 483
  • 2
  • 10
  • Already checked it. But my concern is whether it would work when I need to dynamically create these controls. – Nemo Feb 20 '12 at 00:45