Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping added controls on postback
Message
 
To
21/05/2006 02:47:27
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01123789
Message ID:
01123792
Views:
18
This message has been marked as the solution to the initial question of the thread.
>I just discovered that added controls, from the code behind, are lost on postbacks. Those controls are added from the code behind because there is a lot of business logic that will determine what controls to add on the form based on the tables. However, on postbacks, they all disappear. What would be the proper approach to use in such situation?

You need to add the controls eaerlier in the Page cycle. If you load them on Page_Load as I suspect you are POST back assignment (as well as Viewstate) have already occurred. You'll want to try and do this in OnInit() if possible...
+++ 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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform