473,792 Members | 3,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

want to display sections automatically in ConfigSection in web.config

Hi

Well i tell you the situation ,

i am having the configsection settings like below.
what i need to do is to display the sections automatically when i add
new section name.
after this the all section settings coresponding to section name will
be displayed.

I am able to display the section settings by statically giving it name
in my code behind ,

right now i am using the section name statically as

"Settings-en-gb" ,but i need to display all the sections automatically.
Like it pickup the section name one by one and shows its corresponding
settings.
just tell me how i can track all section name counts and there names.
*************** ********Code i am using to Display******** ********

Dim MyNameValueColl ection As Specialized.Nam eValueCollectio n

MyNameValueColl ection =
ConfigurationSe ttings.GetConfi g("Settings-en-gb")

Dim test(MyNameValu eCollection.Cou nt) As String

If MyNameValueColl ection.Count > 0 Then
test = MyNameValueColl ection.AllKeys
End If
Dim i As Integer
Dim table As String

table = "<Table border=1>"
For i = 0 To MyNameValueColl ection.Count - 1

table = table + "<tr><td>" + test(i) + " </td><td>" +
MyNameValueColl ection(test(i)) + "</td></tr>"

Next
table = table + "</table>"
Label1.Text = table


*************** **My Web.Config Settings******* *************** ***

<configSections >

<section name="Settings-en-gb"
type="System.Co nfiguration.Nam eValueSectionHa ndler,system,Ve rsion=1.0.3300. *0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9,Custom=null" />

<section name="Settings-en-in"
type="System.Co nfiguration.Nam eValueSectionHa ndler,system,Ve rsion=1.0.3300. *0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9,Custom=null" />

</configSections>

<Settings-en-gb>
<add key="ROOT_DIREC TORY" value="" />
<add key="EXT_TO_INC LUDE" value="*.aspx" />
<add key="FILENAME_T O_EXCLUDE" value="ABC.ASPX " />
<add key="DIRECTORYN AME_TO_EXCLUDE" value="Utilitie s" />
<add key="XML_FILENA ME" value="SITEMAP-EN-GB.XML" />
<add key="XML_FILE_P ATH" value="C:\" />
<add key="URL_PREFIX " value="http://visitbritain.co m/vb3- en-gb/" />

<add key="DEFAULT_CH ANGE_FREQUENCY" value="always" />
<add key="DEFAULT_PR IORITY" value="0.8" />

</Settings-en-gb>
<Settings-en-in>

<add key="ROOT_DIREC TORY" value="" />
<add key="EXT_TO_INC LUDE" value="*.aspx" />
<add key="FILENAME_T O_EXCLUDE" value="ABC.ASPX " />
<add key="DIRECTORYN AME_TO_EXCLUDE" value="Utilitie s" />
<add key="XML_FILENA ME" value="SITEMAP-EN-GB.XML" />
<add key="XML_FILE_P ATH" value="C:\" />
<add key="URL_PREFIX " value="http://visitbritain.co m/vb3-en-gb/" />
<add key="DEFAULT_CH ANGE_FREQUENCY" value="always" />
<add key="DEFAULT_PR IORITY" value="0.8" />

</Settings-en-in>

Sep 21 '05 #1
0 1749

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
40769
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
3
1926
by: Robert | last post by:
I have an application with custom configuration sections in it's app.config file. Here's a shortened excerpt: <monitors> <monitor type="SystemMonitor.Monitors.NetworkAvailabilityMonitor,SystemMonitor"> <notifiers> <notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,SystemMonitor" />
0
1013
by: Marauderz | last post by:
Hi guys, having a weird problem here. I've declare a custom config section in my web.config file with the following lines <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ClientCaps" type="System.Configuration.DictionarySectionHandler,System" />
1
1611
by: Paloma García | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconDeclaringCustomConfigurationSections.asp The problem is that I using the same code and I get the error "Object reference not set to an instance of an object" in the line where I try to read the first parameter (in the page...
0
280
by: yatharth | last post by:
Hi Well i tell you the situation , i am having the configsection settings like below. what i need to do is to display the sections automatically when i add new section name. after this the all section settings coresponding to section name will
0
1315
by: mlafarlett | last post by:
Geez...seems like i've compared every friggin character...works n this programA but not n programB. I have a config file with multiple sections and when trying to read each section, it works great in one program and not in another. I basically copied and pasted the config file as well as the section handlers , changed references from programA to programB but on every section in programB I get like "Could not create...
3
2107
by: DarthContinent | last post by:
I have multiple websites running under Windows 2003 using IIS and ASP ..NET. I'd like to be able to take multiple Web.config files and parse sections of them out for display in a datagrid or to place in some other type of collection object. Could someone please link me with samples that illustrate how to extract sections in this manner? I'd like to know both how to extract the info straight from the Web.config file itself, as well as...
9
2721
by: Milsnips | last post by:
Hi all. i'm tryng to implement the Rewrite.NET url rewritining functionality into a test project i've created, however i am hitting a problem at this line (direct from the web example): System.Collections.Specialized.NameValueCollection SectionIndex = (System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Rewrite.NET/Index"); The value always returns me null, and just to check it was...
0
1339
by: Andrea Anastasescu | last post by:
Hi everybody, Inside the web.config of my application I have some custom sections. I have my own handlers for these sections, and their content is in external files. My problem is that ConfigurationManager do not detects that these external files are changed. In case that I "touch" the web.config file, just save it or something, the content of the files are re-read. Is there any possibility to make ConfigurationManager detect that these...
0
9670
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
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
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
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
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.