Global Variables

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.
 
M

Morgan

Could you not use the session? That would be independent of a single
application on a specific server.
 
M

martin

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.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top