我可以跳过ASP.NET菜单控件中的节点吗?

jua*_*uan 2 asp.net web.sitemap

我有一个像这样的web.sitemap:

<siteMapNode url="~/Default.aspx" title="Home" description="" >
    <siteMapNode title="Node 1" description="">
        <siteMapNode url="" title="Node 1-1" description="" />
        <siteMapNode url="" title="Node 1-2" description="" />
    </siteMapNode>
    <siteMapNode title="Node 2" description="">
        <siteMapNode url="" title="Node 2-1" description="" />
        <siteMapNode url="" title="Node 2-2" description="" />
    </siteMapNode>
</siteMapNode>
Run Code Online (Sandbox Code Playgroud)

如果我使用ASP.NET菜单控件(使用StaticDisplayLevels = 2),我会得到:

| 主页| 节点1 | 节点2 |

是否有跳过"Home"并获取此菜单的属性(来自该站点地图):

| 节点1 | 节点2 |

And*_*ose 6

如果您使用的是SiteMapsDataSource,则可以通过将ShowStartingNode属性设置为false来跳过根节点.