Newbie : Setting Application Wide Data

  • Thread starter Thread starter Ash
  • Start date Start date
A

Ash

Where is the best place to define application wide data (not necessarily
config settings), and why? eg. suppose I wanted to define an array of valid
image file types (*.bmp, *.gif, *.jpg), is it best to store this as an
application array in the global.asax, or set of XML nodes in the appSettings
of the web.config file, or neither.

tia
Ash
 
You could store this information in web.config, but you'd probably have to
write a custom handler to parse the data. I find the easiest way is to have
a class which exposes global application-wide data through static methods or
properties (so you don't have to instantiate the class to get the data).

Mun
 
Back
Top