asp.netweb.sitemap

Can I skip nodes in ASP.NET Menu Control?


I have a web.sitemap like this:

<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>

If I use an ASP.NET menu control (with StaticDisplayLevels=2), I get this:

| Home | Node 1 | Node 2 |

Is there a property for skipping "Home" and get this menu (from that sitemap):

| Node 1 | Node 2 |

?


Solution

  • If you are using a SiteMapsDataSource you can skip the root node by setting the ShowStartingNode property to false.