Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping added controls on postback
Message
 
To
21/05/2006 15:56:29
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:
01123878
Views:
17
>>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...
>
>I think you thought that I was trying to find a way to obtain my control values back in their view state. What I meant what about the controls themselves. I found today that those controls need to be added everytime a postback is done. However, based on what you wrote, the view state is preserved by moving that initialization code in the form Init().

Yeah of course controls neeed to be added every time - the page doesn't stay in memory it's a class that gets reloaded on every request.

Both viewstate and post data get reassigned on postback but it happens before Page_Load() so if ou looad controls there it's too late for them to be assigned.

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