I need to update web.config dynamically? So this is what I did, this code below has done the trick for me.
Make sure to add System.Web.Configuration in the namespace. Have funstring value = "webmaster@company.com";Configuration config = webConfigurationManager.OpenWebConfiguration("~");AppSettingsSection appsetting = config.GetSection("appSettings");appsetting.Settings("fromAddress").Value = value;config.Save();
No comments:
Post a Comment