473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
2 1519
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marek | last post by:
Hi there, my WinForm application has to be installed in "no-touch-deployment" mode, so users can run it from the web. I need to read application's .config file but it does not work in ...
1
by: Kevin Lewis | last post by:
Is there .NET framework code that I can call from an assembly (.dll), that will load the settings of a configuration file into the .NET framework. For example you can set up Switches and...
0
by: Mark Friedman | last post by:
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...
3
by: Augustin Prasanna. J | last post by:
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...
2
by: Tony Jones | last post by:
Is it possible for me to create a class library DLL and have it read it's configuration settings from the web.config of the ASP.NET application referencing it? IE - if I call...
1
by: Abraham Andres Luna | last post by:
hello everyone, i set up a folder to have integrated windows authentication through iis. in order for this to work with asp.net, i have to set the identity.impersonate=true in the web.config for...
3
by: davepkz | last post by:
I have a basic question about managing user.config settings: In my C# app, I save the user's preferences to the config file. But each time I release a new build of the app, something in .NET...
1
by: Todd Brewer | last post by:
I have an ASP.NET web site that uses a .NET dll. The DLL has a DataSet in it. Problem is, the DLL uses an app.config file (and worse yet, it uses the stupid settings.settings file, which in turn...
0
by: CSharpner | last post by:
How can I do the following?: Have a label on a form have its Text property bound to a setting from one of my DLL library's config files? I've followed these instructions to successfully get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.