-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: rags_rao
Message 2 in Discussion


of 
course it possible. just load web.config as xmldocument -> play with it - 
> save it back


XmlDocument doc = 
new XmlDocument();

doc.Load(Server.MapPath(@".\web.config"));

XmlNode appSetings = 
doc.SelectSingleNode("configuration/appSettings");

XmlElement nodeAdd = 
doc.CreateElement("add");

nodeAdd.SetAttribute("key","myKey");

nodeAdd.SetAttribute("value","myVal");

doc.Save(Server.MapPath(@".\web.config"));

Response.Write("Works like a charm!"); 

works 
like a charm indeed and  this can be done from with in ur application 
too.

Thats 
the good part, the bad part is there is a catch to it. As soon as save executes 
the correspoding asp application is restarted,which means all sessions will 
expire,data in cache,appln objects will be lost

conclusion: it is possible to dynamically update 
web.config, but it wont do much good. In other words the solution suggested is 
no solution at all.

 

--

"O! 
great creator of the being grant us one more hour to perform our art and perfect 
our  lives"
- Jim Morrison

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to