System.Configuration.ConfigurationSettings.AppSettings.Get(...)

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

Hi,

I have a situation where I am attempting to print the contents of an
AppSettings property in the aspx file of my website. Basically here is the
code I am using:
<% Response.Write("Email:" &
System.Configuration.ConfigurationSettings.AppSettings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail property
of the AppSettings.

What am I missing???

Thanks,
Ron
 
I tried you code and it prints okay here.
Is WebMasterEmail case sensitive?
Is it correct in your web.config ??

Check you web.config file.

SA
 
RSH,
in C#,

System.Configuration.ConfigurationSettings.AppSettings["WebMasterEmail"]

--with square brackets.

This assumes ASP.NET 1.1 and that your element looks like so:

<appSettings>
<add key="WebMasterEmail" value="whateveritis" />
</appSettings>

Note that **everything** is case-sensitive!
Peter
 
Goto ASP.NET group....

I tried you code and it prints okay here.
Is WebMasterEmail case sensitive?
Is it correct in your web.config ??

Check you web.config file.

SA
 
Back
Top