MvcSiteMapNode that does not have a controller

My site should print the following menu:

  • Customers (no link)
    • List / Customers / Index
    • New / Customers / New

The root menu should not be any link, it is just a container for storing the actual submenu. Can this be done using mvcSiteMap?

I tried the following, but the "List" is never CurrentNode. "Clients" always get IsCurrentNode, and I can not use css for writing because of this:

<mvcSiteMapNode title="Home" controller="Home" action="Index" visibility="MenuHelper,!*">
 <mvcSiteMapNode title="Customers" controller="Customer" action="Index" area="Admin" clickable="false" description="Todos os clientes cadastrados" cssClass="icon-group">
   <mvcSiteMapNode title="List" action="Index" description="Todos os clientes cadastrados"/>
   <mvcSiteMapNode title="the customers" action="Details" preservedRouteParameters="customerId" visibility="SiteMapPathHelper,!*"/>
   <mvcSiteMapNode title="New" action="New" />
 </mvcSiteMapNode>
</mvcSiteMapNode>
+3
source share
1 answer

You just need to remove the “Index” from the group without clicking the node so that it never matches. Basically, you have 2 nodes with the same route signature here:

= "Admin" = "" = "Index"

, SiteMap, . , "" ( , , node, ), , .

<mvcSiteMapNode title="Home" controller="Home" action="Index" visibility="MenuHelper,!*">
 <mvcSiteMapNode title="Customers" controller="Customer" area="Admin" clickable="false" description="Todos os clientes cadastrados" cssClass="icon-group">
   <mvcSiteMapNode title="List" action="Index" description="Todos os clientes cadastrados"/>
   <mvcSiteMapNode title="the customers" action="Details" preservedRouteParameters="customerId" visibility="SiteMapPathHelper,!*"/>
   <mvcSiteMapNode title="New" action="New" />
 </mvcSiteMapNode>
</mvcSiteMapNode>
+3

All Articles