Sometime we need to add custom tags or key in web.config. It is easy to add key in <appSettings> and easy to access fromc# code.
web.config looks like that:
<appSettings>
<add key=”Name” value=”Ashrafur Rahaman”/>
<add key=”Address” value=”Kuala Lumpur, Malaysia” />
<add key=”Contact” value=”faisal10dec@gmail.com” />
</appSettings>
c# code for access key value:
using System.Collections.Specialized;
using System.Configuration;
NameValueCollection sAll = ConfigurationManager.AppSettings;
foreach (string s in [...]
Archive for December, 2007
add Key tag in web.config appSettings / custom tag in web.config
Posted in C#.NET, tagged C#.net, web.config on December 31, 2007 | 6 Comments »

