TKC Blog
16

 

To change one of the appSettings values in your web.config through VB.net use the example below.  Keep in mind when you do the save it will reformat you web.config and remove comments that have been inserted manually.

Sub ChangeSetting()
 

Dim Cfg As Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)

    Dim AppSettingSec As AppSettingsSection = Cfg.GetSection("appSettings")

    AppSettingSec.Settings("CachemodeOn").Value = True

    Cfg.Save()
 

 End Sub

 

 

 

 

 

Search Blog