Option 2: Store your config values in a database and retrieve them as
necessary and/or during Application_Start.
Option 3: Have multiple Web.config files. In order to do this, the files
must exist at different levels in, or relative to, the application. Config
files can or do exist at the server level, the site level (in the site
root), or in sub folders. If in sub folders, then the settings apply to only
the pages etc within the respective sub folders. But as far as having
multiple config files at the same "level" (e.g., in the site root), I
believe this is not possible, unless you go witth reading them as plain ole'
XML documents and not reading them via the .NET configuration system.
-HTH
"Fresno Bob" <nos...@nospam.com> wrote in message
news:00F25AB6-7D05-405D...@microsoft.com...
- I remember to ahve seen that you can reference include files from your
web.config file (made a qucik search and it looks like this is done using
the configSource attribute)
- you can put all settings in a single web.config file and retrieve the
appropriate section/entry based on the current host name
--
Patrice
"Robert Cramer" <A...@B.com> a écrit dans le message de news:
e2LRz9ro...@TK2MSFTNGP03.phx.gbl...
You can define a "configSource=........" attribute for just about
every section in your web.config, to "externalize" your config
settings to separate files:
<?xml version="1.0"?>
<configuration>
<system.web>
<pages>
...
</pages>
</system.web>
<system.serviceModel>
<bindings configSource="serviceModel_bindings.config"/>
<client configSource="serviceModel_client.config"/>
.......
</system.serviceModel>
<connectionStrings configSource="connectionStrings.config" />
.......
</configuration>
Those external config files now simply contain the section that you
would normally have directly in your web.config, e.g.
connectionStrings.config:
<?xml version="1.0" encoding="utf-8" ?>
<connectionStrings>
<add name="default" connectionString="........"/>
</connectionStrings>
That alone can make your web.config a lot more readable right there -
and it's totally built in, no extra custom code needed - nada.
Hope this helps.
Marc
"Marc Scheuner" <no....@for.me> wrote in message
news:gn8m04pnotrs098kp...@4ax.com...