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
Divers
Thread ID:
00863033
Message ID:
00863740
Vues:
7
What types of controls are you adding? Custom controls or stock controls?

If you add custom controls you will have to manage view state in those controls yourself - IOW, they have to update viewstate as needed in order to post it back...

Viewstate is enabled by default, so it should work OK...

+++ Rick ---

>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?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform