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
 
It looks like he is using VB.NET and asking a Web Question in C# group.
???

SA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top