Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0 static variables in Global.asax

Reply
Thread Tools

ASP.NET 2.0 static variables in Global.asax

 
 
drasko
Guest
Posts: n/a
 
      09-08-2006
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

 
Reply With Quote
 
 
 
 
Tim_Mac
Guest
Posts: n/a
 
      09-08-2006
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



"drasko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.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
>



 
Reply With Quote
 
 
 
 
drasko
Guest
Posts: n/a
 
      09-11-2006
Hi, Tim!

That's the real answer for my question.

Thanx,
Drasko

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread safety problems with function scope static variables vs class static private members Hicham Mouline C++ 5 12-19-2008 08:10 PM
Static inline functions with static local variables Martin Wells C Programming 10 10-08-2007 03:38 PM
How can I access non-static variables from static funcition? Neviton C++ 9 09-17-2007 10:21 PM
Session Variables and Static Variables cobus.lombard@gmail.com ASP .Net 1 03-26-2006 11:05 AM
Instantiating a static class( Class with all static members - methods and variables) SaravanaKumar Java 6 10-19-2004 08:20 AM



Advertisments