ASP.NET 2.0 static variables in Global.asax

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
 
T

Tim_Mac

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top