Dynamic Session State Mode inside of Web.Config

  • Thread starter Thread starter Beach Bum
  • Start date Start date
B

Beach Bum

Is there a way to dynamically choose what session state server inside
of web.config similar in the way you can change options inside of the
appSettings using the file attribute of the appSettings tag? We are
using the following setup for our development machines and we would
like to use a separate Session State Server for our development
environment

Inside of web.config:
<Configuration >
<appSettings file=optional.config>
<add key=DB_ServerName
value="ProductionServer;Database=DB1;Trusted_Connection=True;"/>

Inside of optional.config (only on development machine):
<appSettings>
<add key=DB_ServerName
value="DevlopmentServer;database=DB1;uid=db_user;pwd=password;"/>
 
I was trying to avoid this ... is there a way to use an app setting in
another part of web.config ?

for example:

<add key="StateServerMode" value="SQLServer " />
<add key="StateServerConnection" value="data source=Prod / Dev
Server;uid=User;pwd=password;" />

then use something like the following ????

<sessionState
mode= StateServerMode
SqlConnectionString= StateServerConnection
timeout="20"
/>
 
Back
Top