Re: How are static variables handled in asp.net
From: Scott Allen (bitmask_at_[nospam)
Date: 09/09/04
- Next message: Greg Burns: "Re: PopUp Window from Codebehind"
- Previous message: mgonzales3: "Hosted Win Form ctrl in IE"
- In reply to: Frank Mamone: "Re: How are static variables handled in asp.net"
- Next in thread: Frank Mamone: "Re: How are static variables handled in asp.net"
- Reply: Frank Mamone: "Re: How are static variables handled in asp.net"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 09 Sep 2004 14:57:30 -0400
Hi Frank:
If I have this class in an ASP.NET project:
public class Foo
{
public static string Bar
{
get
{
// pull a string from the config file,
// the database, a resource file, etc..
}
}
}
Then I can write:
Foo.Bar
from anywhere else in code to pull back the string I need. Public
static members are global and always available (which can make them a
double edged sword in some scenarios).
VB.NET works the same way, except the keyword is "Shared" instead of
static.
-- Scott http://www.OdeToCode.com On Thu, 9 Sep 2004 14:14:10 -0400, "Frank Mamone" <frankmnospam@canada.com> wrote: >How do you use static variables? > >Is that like global variables that are always available? > >-Frank > >
- Next message: Greg Burns: "Re: PopUp Window from Codebehind"
- Previous message: mgonzales3: "Hosted Win Form ctrl in IE"
- In reply to: Frank Mamone: "Re: How are static variables handled in asp.net"
- Next in thread: Frank Mamone: "Re: How are static variables handled in asp.net"
- Reply: Frank Mamone: "Re: How are static variables handled in asp.net"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|