自定义栏目/集合中的Web.Config [英] Custom section/collection in Web.Config
问题描述
我有一大堆,我希望能够在我的web.config文件扔路线。我需要一个键和集合中的每个部分/项目二值字段。沿着这个线的东西...
I've got a bunch of routes that I want to be able to throw in my Web.Config file. I need one key and two value fields for each section/item in the collection. Something along the lines of this...
<routes>
<add
key="AdministrationDefault"
url="Administration/"
file="~Administration/Default.aspx" />
<add
key="AdministrationCreateCampaign"
url="Administration/CreateCampaign/"
file="~/Administration/CreateCampaign.aspx" />
<add
key="AdministrationLogout"
url="Administration/Leave/"
file="~/Administration/Leave.aspx" />
</routes>
这可能吗?
Is this possible?
推荐答案
在这里非常相似样本: http://jopinblog.wordpress.com/2007/04/20/custom-configurationsections-in-net-20-config-files/ 结果
这是为自定义栏目官方页面:< A HREF =http://msdn.microsoft.com/en-us/library/2tw134k3.aspx> http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
此外,这里类似的问题:的如何定义与潜在的子元素定制的web.config型材和性能属性?
Very similar sample here: http://jopinblog.wordpress.com/2007/04/20/custom-configurationsections-in-net-20-config-files/
This is official page for custom sections: http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
Also, there is similar question here: How do I define custom web.config sections with potential child elements and attributes for the properties?
这篇关于自定义栏目/集合中的Web.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!