How to read standard (i.e. non-custom) Web.Config settings

Discussion in 'ASP .Net' started by Mark Friedman, Oct 20, 2003.

  1. I've seen lots of documentation on how to create and read custom
    configuration settings but I'm interested in reading a standard setting
    (i.e. the loginUrl attribute of the authentication/forms setting). Do I
    have to resort to using straight XML reading or is there some other way to
    access standard config settings?

    Thanks in advance.

    -Mark
     
    Mark Friedman, Oct 20, 2003
    #1
    1. Advertising

  2. I haven't tried this, but in theory it should work.

    1) Look in <configSections> portion of machine.config to find out which
    section handler is used to parse the settings you are interested in.
    (probably System.Web.Configuration.AuthenticationConfigHandler in your
    example)

    2) Figure out what data type is returned by that section handler (probably
    available from the documentation).

    3) Call System.Configuration.ConfigurationSettings.GetConfig() on the
    section you are interested in, and cast the result to the data type you
    found in step 2

    4) Read the properties of the returned object to get the settings.



    "Mark Friedman" <> wrote in message
    news:...
    > I've seen lots of documentation on how to create and read custom
    > configuration settings but I'm interested in reading a standard setting
    > (i.e. the loginUrl attribute of the authentication/forms setting). Do I
    > have to resort to using straight XML reading or is there some other way to
    > access standard config settings?
    >
    > Thanks in advance.
    >
    > -Mark
    >
    >
    >
     
    Joshua Flanagan, Oct 21, 2003
    #2
    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. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=

    Web.Config Get Config settings at runtime.

    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,297
    Kevin Spencer
    Feb 6, 2004
  2. =?Utf-8?B?QUY=?=

    web.config custom error settings

    =?Utf-8?B?QUY=?=, May 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,098
    =?Utf-8?B?QUY=?=
    May 17, 2004
  3. CSharpner
    Replies:
    0
    Views:
    1,109
    CSharpner
    Apr 9, 2007
  4. leeanne
    Replies:
    0
    Views:
    1,914
    leeanne
    Sep 24, 2008
  5. donet programmer
    Replies:
    3
    Views:
    1,620
    Gregory A. Beamer
    Nov 20, 2009
Loading...

Share This Page