I need to read keys from web.config file. Here's what I write
string userName = System.Configuration.ConfigurationManager.AppSettings["PFUserName"];
string password = System.Configuration.ConfigurationManager.AppSettings["PFPassWord"];
And this is the appSettings in the Web.config:
<configuration>
....
<appSettings>
<add key="PFUserName" value="myusername"/>
<add key="PFPassWord" value="mypassword"/>
</appSettings>
....
</configuration>
When I debug the code, the username and password are both null, indicating that the keys are not being read.
What am I doing wrong when it comes to reading these numbers?