Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controls collection
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01388377
Message ID:
01388640
Views:
36
>>>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform