473,523 Members | 3,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Configuration.ConfigurationSettings.AppSett ings.Get(...)

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.AppSett ings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail property
of the AppSettings.

What am I missing???

Thanks,
Ron
May 3 '06 #1
4 2347
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" <wa*************@yahoo.com> wrote in message
news:e5**************@TK2MSFTNGP05.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.AppSett ings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail
property
of the AppSettings.

What am I missing???

Thanks,
Ron

May 3 '06 #2
RSH,
in C#,

System.Configuration.ConfigurationSettings.AppSett ings["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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"RSH" wrote:
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.AppSett ings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail property
of the AppSettings.

What am I missing???

Thanks,
Ron

May 3 '06 #3
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
"RSH" <wa*************@yahoo.com> wrote in message
news:e5**************@TK2MSFTNGP05.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.AppSett ings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail
property
of the AppSettings.

What am I missing???

Thanks,
Ron

May 3 '06 #4
It looks like he is using VB.NET and asking a Web Question in C# group.
???

SA

"RSH" <wa*************@yahoo.com> wrote in message
news:e5**************@TK2MSFTNGP05.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.AppSett ings.Get("WebMasterEmail")
) %>
The Email part of the string prints out but not the WebMasterEmail
property
of the AppSettings.

What am I missing???

Thanks,
Ron

May 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
263
by: runningdog | last post by:
HI, Sorry if this is a bit long winded I'm working on a suite of winapps that need to use two levels of configuration data; application level and solution level. I found a reference on MSDN that suggested that app.config file can import data from another file at runtime....
1
2151
by: Jason Huang | last post by:
Hi, I've created an ODBC connection with SQL Server 2000, for conneting to MyDatabase. In the process of building that ODBC connection, I test the connection and fine with no problem. However, in my C#.Net project, I add a CrystalReport MyReport to my project, then I test running MyReport, it will pop out a small box asking me to key in...
6
6077
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 I received an error message: "The ConnectionString property has not been initialized.
1
4307
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix this??): System.Diagnostics.Trace.WriteLine(System.DateTime.Now.ToLongTimeString()+ "--" + dirException.ToString());...
2
1431
by: RSH | last post by:
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...
5
5010
by: Joe Reiss | last post by:
Using vs2005, C# I'm writing some code to settings out of my app.config file. I seemed to be missing many fields from System.Configuration. For example System.Configuration.Configuration will not compile. Why am I missing so many methods from this namespace? Thanks, Joe
3
5800
by: Jyothi Kumar | last post by:
Hi, my project is a migrated project from VS 2003 to VS 2005, in this project I used System.Configuration.ConfigurationSettings.AppSettings, now in VS 2005 it is giving a warning Message like: ConfigurationSettings.AppSettings is Obsolete, please replace with ConfigurationManager.AppSettings, but Iam unable to find this ConfigurationManager class...
2
5318
by: mark4asp | last post by:
In trying to get the C# conversion code for Head First Design Patterns to work I came accross a number of warnings. e.g. Warning Number: 10 Description: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by...
2
2710
by: pantagruel | last post by:
Hi, I have a Visual studio 2005 project that runs as a Windows Service. In it I have declared that I am using System.Configuration. I have set one application setting for the service using the settings panel. When I try to do the following;
0
7326
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7216
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4810
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3308
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3298
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1690
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
535
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.