Monday, March 26, 2012

Newbie : Setting Application Wide Data

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
AshYou 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

"Ash" <aschel.kritsos@.[DELETEME]ecb.co.uk> wrote in message
news:uQsajKHqDHA.1444@.tk2msftngp13.phx.gbl...
> 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

0 comments:

Post a Comment