PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

ASP.NET 2.0 static variables in Global.asax

 
 
drasko
Guest
Posts: n/a
 
      8th Sep 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
 
      8th Sep 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)...
> 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
 
      11th Sep 2006
Hi, Tim!

That's the real answer for my question.

Thanx,
Drasko

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Global.asax Variables Yehia A.Salam Microsoft ASP .NET 10 18th May 2007 01:34 PM
static variables in global.asax Sahil Malik [MVP] Microsoft ASP .NET 25 15th Nov 2005 02:55 PM
static variables in global.asax Sahil Malik [MVP] Microsoft C# .NET 25 15th Nov 2005 02:55 PM
Access static property in Global.asax Brian Vallelunga Microsoft ASP .NET 0 18th Mar 2005 06:41 PM
Global.asax variables ? WJ Microsoft ASP .NET 1 18th Apr 2004 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 AM.