Why do you want to store and edit this in the web.config file? Why not
in a standalone xml file located in a sub-directory? I would be very
hesitant to provide any functionality that edits the web.config file
directly....

I would just use a strongly-typed dataset, and then load/modify/save it
to file. In addition, look at the caching features -- cache the dataset
once it's loaded, and establish a file dependency (so when you do need
to modify the file, the cache is invalidated).

John


-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
Kerry Whelan
Sent: Thursday, May 16, 2002 3:26 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Accessing and editing the web.config file


Hi,
I am trying to edit different sections of the web.config file. I can
gain access to configSections that I have defined using
ConfigurationSettings.GetConfig(People/owner) in my code when the
web.config file is as follows:-

..
<configSections>
   <sectionGroup name="People">
 <section name="owner"
type="System.Configuration.SingleTagSectionHandler, System,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowLocation="false" />
       <section name="seller"
type="System.Configuration.SingleTagSectionHandler, System,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowLocation="false" />
   </sectionGroup>
</configSections>

<!-- Custom Xpplication settings. -->
  <People>
  <owner name="Joe" age="30"/>
         <seller name="Jack" age="20"/>
  </People>

What is the best way to go about changing Joe's name through my C# web
application?

Also I am having difficulties in accessing any of the sections within
the system.web section. How can I access and edit a value for example:-
<sessionState Cookieless="false"> I have tried using bool nocookies =
Session.Cookieless but I am looking for a generic method like
ConfigurationSettings.GetConfig(section/value).

Any help would be greatly appreciated.

Kerry

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to