views:

297

answers:

1

I need to create a custom block in web config as follows:

<MySettings>
    <add name="name1" value="value1" />
    <add name="name2" value="value2" />
    <add name="name3" value="value3" />
    ...
</MySettings>

Ad i understand, i should derive my custom settings class from ConfigurationSection, but i don't know how to make it scalable. I need to add a lot of items to that block, and use it as a key-value pair.

I also understand that it's possible to do it all through section, but i need to create a custom one, since key and value fields might not be enough for me and i will need to extend them.

Thank you very much for assistance!

+2  A: 

To create a structure of add/clear/remove child elements the type matching the MySettings element needs to derive from ConfigurationElementCollection.

Richard
Thank you! that was exactly what i needed!i will post a full version of solution for further usage of community!
ifesdjeen