Can you please describe the layout of your web environment?

If you want to "encapsulate" it, the best way to store it is in web.config file...

Is this what you mean?

/Henrik