Friday 23 August 2013

How do I maintain the correct Breadcrumb trail if the same mvcSiteMapNode appears in different places in mvc.SiteMap?

How do I maintain the correct Breadcrumb trail if the same mvcSiteMapNode
appears in different places in mvc.SiteMap?

I have a SiteMapNode hanging off the main Dashboard SiteMapNode:
<mvcSiteMapNode title="Dashboard" controller="DB" action="Index">
<mvcSiteMapNode title="Company Users" controller="SGAccount"
action="ListSOU" preservedRouteParameters="OrgId,caller"/>
The breadcrumb produced by the above is: "Dashboard > Company Users"
I want to also reference this, and get "Dashboard > Yours Sub > Company
Users"
<mvcSiteMapNode title="Dashboard" controller="DB" action="Index">
<mvcSiteMapNode title="Your Sub" controller="SOU" action="ListSub">
<mvcSiteMapNode title="Company Users" controller="SGAccount"
action="ListSOU" preservedRouteParameters="OrgId,caller"/>
</mvcSiteMapNode>
</mvcSiteMapNode>
However I still get : "Dashboard > Company Users"
I suspect it is still pattern matching against the first SiteMapNode.
How can I ensure that the correct SiteMapNode is used, and thus produces
the correct BreadCrumb Trail. Incidentally the Controller and Action is
the same, so I am not sure how useful Action Attributes will be?
Many thanks.

No comments:

Post a Comment