Try this:
string keyvalue = System.Configuration.ConfigurationManager.AppSettings["keyname"];
In the web.config file this should be the next structure:
<configuration><appSettings><add key="keyname" value="keyvalue" /></appSettings></configuration>
Try this:
string keyvalue = System.Configuration.ConfigurationManager.AppSettings["keyname"];
In the web.config file this should be the next structure:
<configuration><appSettings><add key="keyname" value="keyvalue" /></appSettings></configuration>