I am the SiteConfiguration class to call all my appSetting applications this way. I share this if it helps someone.
add the following code to the "web.config" file
<configuration> <configSections> </configSections> <appSettings> <add key="appKeyString" value="abc" /> <add key="appKeyInt" value="123" /> </appSettings> </configuration>
Now you can define a class to get all your appSetting value. like this
using System; using System.Configuration; namespace Configuration { public static class SiteConfigurationReader { public static String appKeyString
Now add the link of the previous class and get access to the key call, as shown below:
string appKeyStringVal= SiteConfigurationReader.appKeyString; int appKeyIntVal= SiteConfigurationReader.appKeyInt; int appKeyStringByPassingKey = SiteConfigurationReader.GetAppSettingsInteger("appKeyInt");
reza.cse08 May 14 '16 at 19:56 2016-05-14 19:56
source share