ConfigurationSettings

Discussion in 'ASP .Net' started by Matthias Knöchlein, Mar 6, 2005.

  1. Hi !!

    How can I access ConfigurationSettings in a server control ?

    thanxs
     
    Matthias Knöchlein, Mar 6, 2005
    #1
    1. Advertising

  2. 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
    >
    >
    >
     
    =?Utf-8?B?S29zdGFkaW4gS29zdG92?=, Mar 6, 2005
    #2
    1. Advertising

  3. 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" <> wrote in
    message news:...
    > 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
    >>
    >>
    >>
     
    Juan T. Llibre, Mar 6, 2005
    #3
  4. 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" <> wrote in
    > message news:...
    > > 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
    > >>
    > >>
    > >>

    >
    >
    >
     
    =?Utf-8?B?Sm9obnNvbiBTbWl0aA==?=, Mar 7, 2005
    #4
  5. 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 > wrote in message
    news:...
    >
    > 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" <> wrote in
    >> message news:...
    >> > 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
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
     
    Juan T. Llibre, Mar 7, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bassel Tabbara [MSFT]

    RE: ConfigurationSettings.AppSettings Error

    Bassel Tabbara [MSFT], Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    700
    Bassel Tabbara [MSFT]
    Jul 7, 2003
  2. Rob Mayo
    Replies:
    6
    Views:
    451
    TJoker .NET [MVP]
    Sep 22, 2003
  3. Guest
    Replies:
    3
    Views:
    3,722
    =?Utf-8?B?TG9yaSBNY0RvbmFsZA==?=
    Feb 23, 2004
  4. [myfirstname]

    ConfigurationSettings vs Application State

    [myfirstname], Feb 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    663
    Teemu Keiski
    Feb 19, 2004
  5. =?Utf-8?B?Sk1E?=
    Replies:
    4
    Views:
    2,419
    Scott Allen
    Jun 30, 2004
Loading...

Share This Page