Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically Adding User Controls
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Dynamically Adding User Controls
Miscellaneous
Thread ID:
00863033
Message ID:
00863033
Views:
43
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?
Brian Burlingame
Software Engineer/Consultant
Olympic Consulting Group
brian.burlingame@ocgworld.com
Next
Reply
Map
View

Click here to load this message in the networking platform