Solved

Modify web.config file through a web page

Posted on 2014-09-11
2
140 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…

726 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