Dynamically change key value in web.config
Suppose there is a key present in web config and which have the value 10.
<add key="Unit" value="10" />
You can modify the value programmatically using this code
Configuration webConfigApp = WebConfigurationManager.OpenWebConfiguration("~");
webConfigApp.AppSettings.Settings["Unit"].Value = "15";
Why Should we use that framework while we have facility to change it through writing code? Can you explain?
I believe the idea of using a framework is to let you write as less code as possible (i.e. not re-invent the wheel by starting from scratch) but still give the flexibility of extending/changing it with your own code per your requirement.
I believe this code is not huge..It's one line of code and programmer don't change value frequently in webconfig.I believe it's not good idea to use a framework instead of writing one line of code.