How do I define custom web.config sections with potential child elements and attributes for the properties?

后端 未结 6 782
梦毁少年i
梦毁少年i 2020-11-29 00:32

The web applications I develop often require co-dependant configuration settings and there are also settings that have to change as we move between each of our environments.

6条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 00:59

    You can accomplish this with Section Handlers. There is a basic overview of how to write one at http://www.codeproject.com/KB/aspnet/ConfigSections.aspx however it refers to app.config which would be pretty much the same as writing one for use in web.config. This will allow you to essentially have your own XML tree in the config file and do some more advanced configuration.

提交回复
热议问题