Monday, January 13, 2014

Overwrite Appsetting in ASP.NET MVC

  var config = WebConfigurationManager.OpenWebConfiguration("~");
  config.AppSettings.Settings["appSettingKey"].Value ="Updated value";
  config.Save(ConfigurationSaveMode.Minimal, false);
  ConfigurationManager.RefreshSection("appSettings");

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates