467,101 Members | 1,144 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,101 developers. It's quick & easy.

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

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

Nov 17 '05 #1
  • viewed: 1355
Share:
2 Replies
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.AuthenticationConfigHandl er 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.GetConf ig() 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" <bi******@yahoo.com> wrote in message
news:OY**************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #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.AuthenticationConfigHandl er 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.GetConf ig() 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" <bi******@yahoo.com> wrote in message
news:OY**************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Friedman | last post: by
3 posts views Thread by Augustin Prasanna. J | last post: by
2 posts views Thread by Tony Jones | last post: by
1 post views Thread by Abraham Andres Luna | last post: by
3 posts views Thread by davepkz@hotmail.com | last post: by
1 post views Thread by Todd Brewer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.