Solved

Modify web.config file through a web page

Posted on 2014-09-11
2
129 Views
Last Modified: 2014-09-11
I would like to create a web page interface to modify the web.config file in regards to keys I've added. Are there any canned solutions out there?

Looking for something by where an admin user logs in and can modify the kay values.

Thank you
0
Comment
Question by:thenrich
2 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
Comment Utility
var configuration = WebConfigurationManager.OpenWebConfiguration("~");
var section = (ConnectionStringsSection)configuration.GetSection("connectionStrings");
section.ConnectionStrings["MyConnectionString"].ConnectionString = "Data Source=...";
configuration.Save();

Also check following articles:
http://www.dotnetcurry.com/showarticle.aspx?ID=102
0
 
LVL 5

Author Comment

by:thenrich
Comment Utility
I've requested that this question be deleted for the following reason:

Found kinda what I was looking for:

http://www.c-sharpcorner.com/blogs/8870/programatically-modifying-and-saving-appsetting-value-in-roo.aspx
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now