I have a user control which contains several buttons, depending on the button pressed a different control is added to the page (lets say button 1 adds a TextBox, button2 add
I personally would handle this using a ListView
. Include all of the controls you need in the ItemTemplate
with Visible=false
and bind them to a small list stored in the viewstate. Programatically set the correct control visible on row databind.
Note you will have to collect your data in the controls and save it in your list before you rebind it.