Home All Groups Group Topic Archive Search About

ASP.NET 2.0 static variables in Global.asax

Author
8 Sep 2006 9:24 AM
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

Author
8 Sep 2006 9:41 AM
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



Show quote
"drasko" <draskosa***@gmail.com> wrote in message
news:1157707490.052447.197860@e3g2000cwe.googlegroups.com...
> 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
>
Author
11 Sep 2006 6:47 AM
drasko
Hi, Tim!

That's the real answer for my question.

Thanx,
Drasko

AddThis Social Bookmark Button