473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

web.config

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
Nov 18 '05 #1
4 2259
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.

"Neil Stevens" <st******@iata.org> wrote in message
news:#U**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
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

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
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.

"Neil Stevens" <st******@iata.org> wrote in message
news:#U**************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #3
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.

"Neil Stevens" <st******@iata.org> wrote in message
news:eX*************@tk2msftngp13.phx.gbl...
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

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
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.

"Neil Stevens" <st******@iata.org> wrote in message
news:#U**************@TK2MSFTNGP10.phx.gbl...
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



Nov 18 '05 #4
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

"Neil Stevens" <st******@iata.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a...
4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
3
by: Richard Lewis Haggard | last post by:
I have a test application that is calling an assembly that reads some strings out of a config file. Normally, this assembly supports a web application and the information can be read just fine....
13
by: Khodr | last post by:
Hello, I am using VS.NET 2003 and vb. I build my application MyApp and it generates MyApp.exe.config. So now MyApp.exe reads parameters from MyApp.exe.config. Great and no problem! I need to...
20
by: tomerfiliba | last post by:
hey i've been seeing lots of config-file-readers for python. be it ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the like. seems like a trend to me. i came to this conclusion...
11
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand...
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
10
by: eagle | last post by:
I have a web.config in my application that contains the connection strings to all my datasources. I want to move these connection strings to another web config up the folder hierarchy so that all...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.