Many times, we need to read sections from web.config or write into web.config.
I have a requirement where i need to write an section in web.config that points to another config file.
Below is the code where “abc” is the section
Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(“~”);
ConfigurationSection section = objConfig.Sections[“abc”];
string str = “abcdef”;
The above code will read “abc” section and write the content in str.
For Reading Appsettings from web.config, below is the code
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); AppSettingsSection appSettings = (AppSettingsSection) config.GetSection(“appSettings“);
string appKeys = appSettings.Settings.AllKeys;
for (int i = 0; i < appSettings.Settings.Count; i++)
This article will explain you how to create, read, insert, update, delete operations with asp.net mvc with Linq To Sql (.dbml).
Very nice article who are beginners with asp.net mvc framework.