By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

How to parse out data in a nested custom configuration in ASP.NET 2.0?

P: n/a
Hi all, I am having problem parsing out a custom configuration that has
nested tags, in much the same way appSettings or configSettings does.
How do I get a hold of the collections of info nested in fileInfo tag?

Also, does anyone know how to use ConfigurationSectionCollection? I
can hardly find any example usage on it.

e.g.

<configSections>
<section name="fileInfo"
type="FileConfigHandler,ConfigurationSectionCollec tion" />
</configSections>

<fileInfo>
<add name="tar" extension="*.tar" />
<add name="zip" extension="*.zip" />
</fileInfo>
Here is the handler:
using System;
using System.Configuration;

/// <summary>
/// Summary description for FileConfigHandler
/// </summary>
public class FileConfigHandler : ConfigurationSection
{
[ConfigurationProperty("name")]
public String name
{
get { return (String)base["name"]; }
set { base["name"] = value; }
}

[ConfigurationProperty("extension")]
public String extension
{
get { return (String)base["extension"]; }
set { base["extension"] = value; }
}
}

Thanks much!

Mar 17 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.