ASP.NET Page Variables Persistence

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mark Anthony Spiteri (mark_at_[remove)
Date: 06/26/04


Date: Sat, 26 Jun 2004 08:08:01 -0700

Hi,

I am designing an ASP.NET application in which particular pages require global variables that need to be persisted during postbacks. What is the best practice to do this?

Is it to use the viewstate object or is declaring the variables as static sufficient (I am currently using this method)?

 

Thank you,

Mark Anthony Spiteri



Relevant Pages

  • Re: Global Variables in OOP and Python
    ... > Agree about from module import * being bad, but it is still generally poor ... > practice for the same reason using global variables is generally poor ... Namespace pollution or name clashes are another issue and we have to ...
    (comp.lang.python)
  • RE: Questions regarding hidding vs closing forms
    ... I would not say it's a bad practice, especially if that Form is eatting up a ... > practice to close the current form when openning a new form? ... > lot performance and memory issues? ... > global variables for these forms, so that I could Show the hidden form from ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Global Variables on a VB.NET Web Page
    ... I have found that I can create global variables easily on a web page by ... placing the dim statement before the first "private sub" in a program: ... Public Sub Page_Load ... memory if the user clicks away - or is this a "great practice". ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global variables for python applications
    ... habit of using global variables! ... Let's say you have a bunch of globals, one of which is a verbose flag. ... If this is what you have in mind, I'm not really seeing how one is good practice and the other is bad. ...
    (comp.lang.python)
  • Re: Global Variables in OOP and Python
    ... >> Agree about from module import * being bad, but it is still generally poor ... >> practice for the same reason using global variables is generally poor ...
    (comp.lang.python)