how to change the webconfig file through programatically

Nov 24 2010 12:08 AM
hi

how to we change the web.config settings through programatically i am able to access the settings but unable to write while i  save it shows access is denied error in the save

the code is

  static  Configuration myConfig=WebConfigurationManager.OpenWebConfiguration("~/");
    static KeyValueConfigurationElement myElement = null;
  
   myelement.value="some xyx";
     myConfig.Save(); -->here it show error
        myConfig.Save(ConfigurationSaveMode.Modified);


Answers (4)