473,395 Members | 1,468 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,395 software developers and data experts.

Change Web.config value programatically

mg
How can I change the value of "timeout" in Web.config

<sessionState timeout="20" />

in one deployed app (project A) from a method call in a
WebForm (C#) that's running in another deployed app
(project B) on the same server.
Nov 18 '05 #1
2 1285
Hi,

Web.config is XML file so if you got rights you can use XMLDocument to
open the fie and edit it. B U T, keep in mind that changing web.config
file cause your application to recycle.
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
This is really not recommended because as soon as you save the web.config to
the disk your whole application will recyle it self. You may want to create
a custom object and then use XmlSerialization to serialize the object to the
disk so that you can pull the object in at the start and write to it as
nessisary. This will not recyle you application, you also have total
control over this method.
"mg" <mg@theworld.com> wrote in message
news:05****************************@phx.gbl...
How can I change the value of "timeout" in Web.config

<sessionState timeout="20" />

in one deployed app (project A) from a method call in a
WebForm (C#) that's running in another deployed app
(project B) on the same server.

Nov 18 '05 #3

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

Similar topics

3
by: Frankie | last post by:
I'm writing a small utility app (C# Windows forms) used to create new ASP.NET Web sites. This utility needs to be able to change existing values in an existing Web.config. Please note: I do NOT...
0
by: Dan Hartshorn | last post by:
VS.NET 2003, C#, Windows Server 2003. I have a datagrid and I want the last column to be either an EditCommandColumn or a template column, depending on a value I have. The value changes for each...
5
by: George | last post by:
Hi, Is it possible to specify the location of a web.config file in an ASP.NET application? I have one ASP.NET application which is to be hosted on 2 web sites in the same web server. I want...
1
by: justin | last post by:
I have the problem that I need to programatically add new url mappings to the web.config file in an asp 2.0 app. e.g. my code is Dim urlMappings As UrlMappingCollection =...
5
by: stand__sure | last post by:
I had occasion tonight to write an installer class that changed something in a config file tonight (I had never had a need to do it, but happened upon a "How To" article that explained it in terms...
2
by: Pieter | last post by:
Hi, I'm using the Settings.settings of VB.NET to define a Connectionstring (Scope = application). When I deploy the Solution, and change this Setting in the app.config-file, it seems that...
12
by: shawnn | last post by:
Hello, By default, when you create an App.config file it gets named as MyApp.exe.config after build. I don't like this name and would rather have the file named MyApp.config, the .exe.config...
1
by: Jeremy Chaney | last post by:
It appears that my user.config file got corrupted causing my "InitializeComponent" routine to throw an exception "Root element is missing." when I start my app. I figure I can just go into...
3
by: Jeremy Chaney | last post by:
It appears that my user.config file got corrupted causing my "InitializeComponent" routine to throw the exception "Root element is missing." when I start my app. I figure I can just go into...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.