Cannot get Application Setting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vvenk

    #1

    Cannot get Application Setting

    Hello:

    I've defined two application settings in my web.config file. But in the
    following code :

    Dim rootWebConfig1 As System.Configur ation.Configura tion
    rootWebConfig1 =
    System.Web.Conf iguration.WebCo nfigurationMana ger.OpenWebConf iguration(Nothi ng)
    If (rootWebConfig1 .AppSettings.Se ttings.Count 0) Then

    sField1 = rootWebConfig1. AppSettings.Set tings("field1")
    sField2 = rootWebConfig1. AppSettings.Set tings("field2")

    End If

    rootWebConfig1. AppSettings.Set tings.Count always returns 0.

    What am I doing wrong?

    Venki
  • dcp12345678@yahoo.com

    #2
    Re: Cannot get Application Setting

    What am I doing wrong?

    The code Microsoft provides doesn't work. I had the exact same problem
    you did.

    You can use AppSettings.Ite m("YourKeyHere" ) to get the value.

    Comment

    Working...