storing settings in asp.net application
there are few variables in my applicati开发者_开发百科on which i need to set and are used at various places. Which is the best place other than web.config file to store them.
Write a class with static members that are set on Application_Start() inside global.asax
If these variables can change their values after application has been built then web.config is the best place to store them. Other options can be database, registry or in short, any persistent medium. Of course, to use these values through-out your application, you should have a wrapper static class that will expose these settings as properties. Settings will be read once at application start-up (or on demand whenever first requested.)
精彩评论