473,804 Members | 3,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1544
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.Conf iguration.Authe nticationConfig Handler in your
example)

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

3) Call System.Configur ation.Configura tionSettings.Ge tConfig() 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******** ******@TK2MSFTN GP10.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.Conf iguration.Authe nticationConfig Handler in your
example)

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

3) Call System.Configur ation.Configura tionSettings.Ge tConfig() 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******** ******@TK2MSFTN GP10.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
2180
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 no-touch-deployment. Could anyone give me directions to documentation piece (or article) that explains how to implement app .config file reading in no-touch-deployment ? (just to clarif the issue, my app is not ASP.NET) I'd appreciate any help, thank you....
1
529
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 TraceListeners through config settings such as: <system.diagnostics> <switches> <add name="MySwitch" value="31" /> </switches> <trace>
0
258
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 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
3
1544
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 web.config from a code behind page. how do i achieve this Thanks Augustin
2
2748
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 ConfigurationSettings.GetConfig("somesection") in one of the base class dll methods, will it/can it return the settings from the web.config? For example, I would like to create a base class library of utility classes that can be used with any ASP.NET application....
1
1238
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 that folder. my questions is, why doesn't the subfolders inherit the impersonate setting. when i try to access a page in a subfolder i am prompted for login info. i guess the answer would be to have a web.config in every subfolder, but i
3
24548
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 creates a new folder (named for the build number) in Documents And Settings. The result is the users lose all their settings and have to start over. What is the standard way to allow users to maintain their settings when they get a new version of...
1
4173
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 builds the app.config). So, now I have to configure settings in the web.config, settings.settings, and app.config! Is there any way to have my DLL use the web.config file and ignore app.config and the settings.settings files? Thx in advance.
0
2444
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 the DLL settings into the web.config: http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_frm/thread/173c2b36f3c679a4/e34b1675db9b4486?lnk=st&q=dotnet+applicationSettings+web.config+dll+properties&rnum=1#e34b1675db9b4486
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.