ASP.NET 2.0 static variables in Global.asax

  • Thread starter Thread starter drasko
  • Start date Start date
D

drasko

In Microsoft Knowledge base, Article ID: 312607 says:
"It is recommended that you store data in static members of the
application class instead of in the Application object."

Does this apply for ASP.NET 2.0? If it does, how can I accomplish this?
I am using c#...

Thanx in advance,

Drasko
 
hi drasko,
in .net 2, i would put the static variable anywhere in App_Code.
e.g.
public class Util
{
public static string Whatever = "Hello";

then anywhere in your site you can use Util.Whatever to access the string,
it will be the same across all sessions and instances of the application.

good luck
tim
 
Back
Top