Modify Web.config value at runtime

var config = WebConfigurationManager.OpenWebConfiguration("~");
var section = (AppSettingsSection)config.GetSection("appSettings");
section.Settings["something"].Value = "newValue";
config.Save();