Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping added controls on postback
Message
 
To
23/05/2006 16:11:17
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:
01125027
Views:
14
>>Nooooo.... where woould preseve them? The page goes away after everyhit! You added the controls manually it's your responsibility. If you put them in Markup ASP.NET manages that for you because it becomes part of the class.
>>
>>You can create a base class and add controls from there and then they will show up everytime in your inherited class.
>
>It could be a setting. Because, in my case, the form should be shown as is on the postback, if the validation fails. The values are preserved and this is good. But, the controls are not and this is what could be made from a setting.

I think you don't understand the way ASP.NET pages work. It's a class. The class is definied by what you put on it. If you add controls to the form after it's been created, it's your responsibility. The form goes away after the page renders.

Thisi sn't a Windows Form that has real state. It's a class that gets created and destroyed on every hit. Hence any controls you added manually aren't going to come back...

It just can't work that way unless you write the code to make it happen. That's really all that ASP.NET does for your automatically when you put the controls on the page. The markup page is the 'persistance' mechanism. No markup - it can't be persisted (well it can using Session or cache, but not the way you want to).

It just can't work that way. Nor should it... it makes no sense.
+++ 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