Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controls collection
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01388377
Message ID:
01388640
Vues:
38
>>>>Hi,
>>>>I have a WebControl - where I programmatically add new controls.
>>>>During Controls.add() - I check Controls.count - it grows... for example it has now 35 controls
>>>>
>>>>I have a button on this page cmdSave - in Click event I check Me.Controls.count - it has just 9 controls.. most of them - controls which I exact drop on control during design time.
>>>>
>
>I see you've resolved it. Yes, adding controls dynamically in ASP.NET is complicated and it's really easy to not get it right which ends up causing all sorts of viewstate issues. The basic idea is that you need to re-add controls on each hit, and they need to be done before the viewstate is loaded (I have mine in the Init). Honestly, after doing a site where the main page does a lot of dynamic loading, I'd avoid it if at all possible.

Time for me to review -- I thought Page_Init() only got called once and Page_Load() gets called on every hit.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform