Global Constants

F

Fred

Hi,

I am working on converting a classic asp site to asp.net. The site
has an include file full of constants that are used across the site.
This file can be dynamically updated and any changes take effect
instantly with no impact on the site (IE the site does not need to be
restarted/recycled in the same way an update to a web.config file
would). This file basically just holds label values so the names can
be changed as and when needed through a web page.

CONST strMaleLabel = "Gents"
CONST strFemaleLabel = "Ladies"

eg. On one page there may be a form asking for input of two values:

Ladies: 0
Gents: 0


The "Ladies" and "Gents" labels are contstants in an include file (as
above) and when changed through a backend webpage the include file is
re-written so the next time the page loads the labels could be
different:

CONST strMaleLabel = "Guys"
CONST strFemaleLabel = "Gals"


Gals: 0
Guys: 0



All of these label values are also stored in a SQL database but I
guess the include file was deemed less of an overhead than an
additional call to the database for every page (the include file is 9K
loads of constants!) .


Can anyone tell me the best way to convert this to asp.net or give
thoughts on doing away with the include and making that call to the db
every page load.


Many Thanks

Fred
 
M

Michel Posseth [MCP]

wel you could easily mimick this behavior with a configuration file ( XML ,
INI or whatever )

regards

Michel Posseth
 

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

Top