473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

ConfigurationSettings

Hi !!

How can I access ConfigurationSettings in a server control ?

thanxs
Nov 19 '05 #1
4 1685
using System.Configuration;

ConfigurationSettings.AppSettings["mySetting"];

In Web.config you should have:
<add key="mySetting" value="myValue">

"Matthias Knöchlein" wrote:
Hi !!

How can I access ConfigurationSettings in a server control ?

thanxs

Nov 19 '05 #2
Remember, in ASP.NET 2.0 this changes to :

VB.NET :
ConfigurationManager.AppSettings("mySetting")

C# :
ConfigurationManager.AppSettings["mySetting"];


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Kostadin Kostov" <Ko************@discussions.microsoft.com> wrote in
message news:15**********************************@microsof t.com...
using System.Configuration;

ConfigurationSettings.AppSettings["mySetting"];

In Web.config you should have:
<add key="mySetting" value="myValue">

"Matthias Knöchlein" wrote:
Hi !!

How can I access ConfigurationSettings in a server control ?

thanxs

Nov 19 '05 #3

VB.NET :
ConfigurationManager.AppSettings("connSetting")

C# :
ConfigurationManager.AppSettings["connString"];
"Juan T. Llibre" wrote:
Remember, in ASP.NET 2.0 this changes to :

VB.NET :
ConfigurationManager.AppSettings("mySetting")

C# :
ConfigurationManager.AppSettings["mySetting"];


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Kostadin Kostov" <Ko************@discussions.microsoft.com> wrote in
message news:15**********************************@microsof t.com...
using System.Configuration;

ConfigurationSettings.AppSettings["mySetting"];

In Web.config you should have:
<add key="mySetting" value="myValue">

"Matthias Knöchlein" wrote:
Hi !!

How can I access ConfigurationSettings in a server control ?

thanxs


Nov 19 '05 #4
Why did you post the exact same syntax I did ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Johnson Smith" <Johnson Sm***@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...

VB.NET :
ConfigurationManager.AppSettings("connSetting")

C# :
ConfigurationManager.AppSettings["connString"];
"Juan T. Llibre" wrote:
Remember, in ASP.NET 2.0 this changes to :

VB.NET :
ConfigurationManager.AppSettings("mySetting")

C# :
ConfigurationManager.AppSettings["mySetting"];


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Kostadin Kostov" <Ko************@discussions.microsoft.com> wrote in
message news:15**********************************@microsof t.com...
> using System.Configuration;
>
> ConfigurationSettings.AppSettings["mySetting"];
>
> In Web.config you should have:
> <add key="mySetting" value="myValue">
>
> "Matthias Knöchlein" wrote:
>
>> Hi !!
>>
>> How can I access ConfigurationSettings in a server control ?
>>
>> thanxs
>>
>>
>>


Nov 19 '05 #5

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

Similar topics

3
by: serge calderara | last post by:
Dear all, I have define a configuration file for my application with different section groups and settings belonging to each individual group like as follow : ...
6
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
3
by: Filippo | last post by:
Hi there, I am writing a Windows App and need a Configuration file. I wonder if I can use the WEB.CONFIG file to store my values. I also wonder if I can use the ConfigurationSettings.AppSettings...
2
by: Mythran | last post by:
public static void Main() { string sectionName = "system.web"; object settings = ConfigurationSettings.GetConfig(sectionName); Console.WriteLine( settings == null ? "(null)" :...
4
by: harvie wang | last post by:
In .Net,Through System.Configuration.ConfigurationSettings Get Application's Settings I can't find the Configuration Value from Register Where the ConfigurationSettings saved? How to Read it...
1
by: [myfirstname] | last post by:
Hello I've seen several examples around the web where people put all the values in ConfigurationSettings.AppSettings into Application State variables in global.asax, like this: foreach...
3
by: Random | last post by:
I'm writing a class library for my web app data access, but don't want to hard code the database connection string in the class. Nor do I want to pass the connection string in from the web app...
3
by: Andrew Fisher | last post by:
Hi all, I have set up some config options in the web.config file and have successfully used them in my test pages. When I came to abstract my code from the design - by using code behind files,...
1
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
2
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: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.