Home All Groups Group Topic Archive Search About

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

Author
3 May 2006 1:36 PM
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

Author
3 May 2006 4:25 PM
Mike Lowery
Just a guess, but I think this method may only work with Windows Forms, not
ASP.Net.  Here's another way to do it:
http://www.odetocode.com/Articles/345.aspx

Show quoteHide quote
"RSH" <way_beyond_o***@yahoo.com> wrote in message
news:ejJ3QarbGHA.1208@TK2MSFTNGP02.phx.gbl...
> 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
>
Author
3 May 2006 5:58 PM
RSH
It works in the CodeBehind, but I need a way to access the property in the
ASPX page.

I suppose I could rearchitect it to call a procedure in the codebehind
file...but I am reworking an existing site and I have to do this in many
places throughout the site.

Thanks,
Ron

Show quoteHide quote
"Mike Lowery" <selfspam@mouse-potato.com> wrote in message
news:ueYBo4sbGHA.4604@TK2MSFTNGP02.phx.gbl...
> Just a guess, but I think this method may only work with Windows Forms,
> not ASP.Net.  Here's another way to do it:
> http://www.odetocode.com/Articles/345.aspx
>
> "RSH" <way_beyond_o***@yahoo.com> wrote in message
> news:ejJ3QarbGHA.1208@TK2MSFTNGP02.phx.gbl...
>> 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
>>
>
>