How to get listing of all sectionGroups in defined subnode of Web.config file?

F

Frank

Hi folks,

based on the Web.config snapshot on bottom I would like to know how to
get a listing of elements in a defined level. Let's assume I would like
to get a list of all sectionGroup elements within the sectionGroup
called "TopLevel". How to do that?

I tried to define the "type" attribute of the sectionGroup elements to
link it to an own settingsHandler, but unfortunately this is not
possible using .Net 1.1.

How to proceed?

Thanks, Frank

<configuration>
<configSections>
<sectionGroup name="TopLevel">
<sectionGroup name="Level1">
<section name="Level1.A" tpye="myOwnSettingsHandler"/>
<section name="Level1.B" tpye="myOwnSettingsHandler" />
</sectionGroup>
<sectionGroup name="Level2">
<section name="Level2.A" tpye="myOwnSettingsHandler"/>
<section name="Level2.B" tpye="myOwnSettingsHandler"/>
</sectionGroup>
<sectionGroup name="Level3">
<section name="Level3.A" tpye="myOwnSettingsHandler"/>
<section name="Level3.B" tpye="myOwnSettingsHandler"/>
</sectionGroup>
</sectionGroup>
</configSections>
</configuration>
 
K

Karl Seguin [MVP]

Why not just treat the web.config like any other XmlDocument and use xPaths?

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top