Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding controls on postback causes a problem
Message
From
29/06/2006 20:06:19
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01132934
Message ID:
01132953
Views:
16
>I am not surprised ASP can't add a control at Postback time. It probably has its own collection of controls that are on the page and can't handle additional ones on the fly.

The problem is not to have the added controls with AddAt() to be back on the form on postback. The problem is all native controls on the form which loose their state as soon as the AddAt() kicks in on postback. This is a known problem with ASP.NET. This is somewhat known as a bug. The control names or something like that gets lost and the reference is no longer applicable. So, when the form loads back, the control state appears in the way it was at first. So, if I comment all AddAt() line, everything is ok on postback.

>Possible workaround -- is the number of additional controls fixed or variable? If it's fixed, you could define them to begin with, invisible, then make them visible at the appropriate time.

This is variable based on child relation. There are about 200 controls that gets added. I have labels, checkboxes, etc. Basically, I have a class in the framework that receives parameters and know how many columns to show, the type of controls, the text to add, the headers, etc. This varies based on the child relation of the form. So, on the form, the only think I put is a Label as a placeholder to indicate where I need to start adding all those AddAt().
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform