Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hi all

Is there any view state in Windows application???

Actually i want the controls present in a panel before reinitialize the panel.
In my project i have create a panel in every 10 second dynamically.
So i wrote that
Panel pnlTest = new Panel();

in the tick event.
After every 10 second the panels controls disappear because the panel is initializing after every 10 second.

But i want the that panel's controls.

So want a View state type thing .

Please suggest

Thanks In advance.
Posted
Updated 18-Apr-12 20:45pm
v2
Comments
Sergey Alexandrovich Kryukov 19-Apr-12 3:00am    
Why? why?!
--SA

What an abuse and nonsense! Is it so hard to understand that the View State is the artifact of quite unusual situation with Web applications, due to the stateless nature of HTTP protocol?
Please see:
http://en.wikipedia.org/wiki/View_State#State_management[^],
http://msdn.microsoft.com/en-us/library/ms972976.aspx[^].

For "normal" application thinking of a View State is nearly the same, as re-loading the whole UI desktop application on every control click (or every 10 seconds :-)) and then restoring the whole state of the state machine. For a normal desktop application developer, it would sound totally wild, but this is what actually happens with Web applications (if we forget about client-side scripting and Ajax for a moment). Applying the same thinking to desktop application is something which… well, I don't even know what to advise, perhaps starting to learn programming from the very beginning.

At the same time, saving and restoring of the status of the application when the whole application is closed and then started again is a really good thing, but this is a very different story. In all cases, you should forget the idea of View State as a nightmare, when it comes to desktop applications. However, everything can happen to a person who wish to overwhelm the application with panels so quickly. Don't even bother to explain why… :-)

—SA
 
Share this answer
 
 
Share this answer
 
Comments
bhagirathimfs 19-Apr-12 2:50am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900