Cannot read application settings

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

    Cannot read application settings

    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

  • Dave Anderson

    #2
    Re: Cannot read application settings

    vvenk wrote:
    >
    rootWebConfig1. AppSettings.Set tings.Count always returns 0.
    >
    What am I doing wrong?
    For one, you are asking in a classic ASP forum. You might have better luck
    in [microsoft.publi c.dotnet.framew ork.aspnet].



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.


    Comment

    • Slim

      #3
      Re: Cannot read application settings


      "vvenk" <vvenk@discussi ons.microsoft.c omwrote in message
      news:5BEE13DE-9821-4AD2-9B20-7CE1A15E796C@mi crosoft.com...
      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?

      posting to a asp group with a asp.net problem

      >
      Venki
      >

      Comment

      Working...