1
我试图使用MvcSiteMapProvider,但创建我自己的自定义布局。我用nuget将MvcSiteMapProvider 3.2.3.0版本安装到我的项目中,并创建了这个文件进行开发。但是,当我试图循环遍历根节点的子节点时,没有任何节点。MvcSiteMap只有根节点
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0"
xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0 MvcSiteMapSchema.xsd"
enableLocalization="true">
<mvcSiteMapNode title="Home" controller="Home" action="Index">
<mvcSiteMapNode title="Reports" controller="Reports" action="Index"/>
<mvcSiteMapNode title="Queries" controller="Queries" action="Index"/>
<mvcSiteMapNode title="Tools" controller="Tools" action="Index">
<mvcSiteMapNode title="Markets" controller="Markets" action="Index">
<mvcSiteMapNode title="Boundary Files" controller="Markets" action="BoundaryFiles" />
<mvcSiteMapNode title="Mass Update" controller="Markets" action="MassUpdate" />
<mvcSiteMapNode title="SHOULD NOT BE HERE" controller="Home" action="Headings" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Categories" controller="Categories" action="Index"/>
<mvcSiteMapNode title="Blasts" controller="Blasts" action="Index">
<mvcSiteMapNode title="Get Blast" controller="Blasts" action="Get" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Alerts" controller="Alerts" action="Index"/>
<mvcSiteMapNode title="Applications" controller="Applications" action="Index"/>
</mvcSiteMapNode>
<mvcSiteMapNode title="Subscribers" controller="Subscribers" action="Index" />
</mvcSiteMapNode>
</mvcSiteMap>
根节点没有出现任何儿童但是:
我无法弄清楚什么是错的。我已经替换为非常行动得到执行的根源,给它一个类似的孩子,但没有奏效:
<mvcSiteMapNode title="ASDFG" controller="Test" action="TestSiteMap">
<mvcSiteMapNode title="ASDFGHJKL" controller="Test" action="TestSiteMap"/>