I am having some difficulty working with dynamically-added user controls and maintaining their viewstate. Hopefully someone can help me out...
I have a web form on which I have an "Add" button that adds a specific user control to a Panel whenever it's clicked. That is, it creates multiple instances of the same user control. The user control contains various web controls, such as textboxes and dropdown lists. I seem to have figured out how to add the user controls dynamically, but only the textboxes maintain their state, not the dropdowns. When I choose an item from a dropdown in one of the user controls, then click "Add" to create another user control, the dropdown value I chose goes away.
I have EnableViewState on for ALL the dropdowns in the user control. What could be happening? Does anyone have some sample code where you're doing the same thing?