Daily Archives: October 17, 2008

1 post

Retrieve web.config file through ASP.NET

How to get a hold of the web.config file in a web application? ASP.NET has a WebConfigurationManager class that has a method called OpenMappedWebConfiguration. It can be used to open a web application configuration file as a configuration object. OpenMappedWebConfiguration has three overloads, and we can use the first one to open the web.config file: WebConfigurationManager.OpenMappedWebConfiguration Method (WebConfigurationFileMap, String) The first parameter is a WebConfigurationFileMap object, which specify the web file hierarchy. The second parameter […]