Solved

Modify web.config file through a web page

Posted on 2014-09-11
2
138 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
ID: 40317420
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
ID: 40317443
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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