Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically Adding User Controls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Dynamically Adding User Controls
Divers
Thread ID:
00863033
Message ID:
00863033
Vues:
41
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform