Web.Config Get Config settings at runtime.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Augustin Prasanna. J

    Web.Config Get Config settings at runtime.

    Hi
    How do i access the settings defined in the web.config during runtime. GetConfig method is used to access the user defined sections. i would like to get the customErrors mode defined in the web.config from a code behind page. how do i achieve this

    Thanks
    Augustin
  • Tommy

    #2
    Re: Web.Config Get Config settings at runtime.

    Load the Web.Config into a XPathDocument object, and use XPath to
    query the node and attribute you need.

    Tommy,

    "Augustin Prasanna. J" <anonymous@disc ussions.microso ft.com> wrote in message news:<FE114EB9-79EC-489A-A87B-771408B3D435@mi crosoft.com>...[color=blue]
    > Hi,
    > How do i access the settings defined in the web.config during runtime. GetConfig method is used to access the user defined sections. i would like to get the customErrors mode defined in the web.config from a code behind page. how do i achieve this?
    >
    >
    > Thanks,
    > Augustin[/color]

    Comment

    • Augustin

      #3
      Re: Web.Config Get Config settings at runtime.

      Hi,
      Is there any other way to access the config settings other than parsing the file. would like to know if there are any classes availble in the API that can be used to read the settings.

      Thanks,
      Augustin

      Comment

      • Kevin Spencer

        #4
        Re: Web.Config Get Config settings at runtime.

        Check out the System.Configur ation namespace.

        --
        HTH,
        Kevin Spencer
        ..Net Developer
        Microsoft MVP
        Big things are made up
        of lots of little things.

        "Augustin" <anonymous@disc ussions.microso ft.com> wrote in message
        news:8A07C04D-2A96-4EC1-B859-8B6E0086ED5E@mi crosoft.com...[color=blue]
        > Hi,
        > Is there any other way to access the config settings other than parsing[/color]
        the file. would like to know if there are any classes availble in the API
        that can be used to read the settings.[color=blue]
        >
        > Thanks,
        > Augustin[/color]


        Comment

        Working...