web.config

  • Thread starter Thread starter Neil Stevens
  • Start date Start date
N

Neil Stevens

Hi,

I am developing a web site and have a number of properties in the web.config
file. These properties need to be changed at run-time from a web page in the
admin section of the web site. Is it possible ot achieve this? and if so
what classes do i need to use?

I have tried using the XmlDocument classes to load and change the values but
have found that if i try to read from the ConfigSettings class i get an
exception that the file is already in use.

Thank in advance for your help.

Regards
Neil
 
You can't change values in the web.config file. What you can do is to create
Application Cache variables FROM the web.config file at the
Application_OnStart event handler, and change those if you need to.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
I have a value in the web.config file that will determine if the site is
open or closed will what you say allow this value to be changed and persist
the change for all users who visit the web site
 
Application Cache is global to the entire application. You can put anything
in there and it will be available to all pages in the web app.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi Neil,

I don't think you can change the config from a web page, for the simple
reason your site will be reloaded as soon as the file is changed, i.e. you
will lose your sessions.
I'd use another xml file and put a reference to it in the web.config.

Hope this helps,
Michel
 
Back
Top