Global Variables

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

Hi,

where is the best place to keep global variables in asp.net.

I want to load a value from a database when the application starts. I know
that i can load this is application_start which is fine. I also know that
mostly storing a global value in an application variable whould be good,
like

application("Variablename") = 5

However I don't wish to do this because application scope does not scale to
a web farm.

should I just do my database call at the start of every page or is there an
easier way.

cheers

martin.
 
Could you not use the session? That would be independent of a single
application on a specific server.
 
Yes I could use the session, but then I am storing the values once for each
user. It will work but is not exactly what I had in mind.

I just want to store a value that all users will be able to access that will
scale to a web farm.
maybe storing in the sesion onject is the best way..

cheers

martin.
 
Back
Top