Monday, 19 August 2013

Is it possible to use multiple SiteMapNodes with the same Controller and Action, but different titles?

Is it possible to use multiple SiteMapNodes with the same Controller and
Action, but different titles?

I am constructing a Wizard, and use the same "Master" Controller and
Action to orchestrate which child controller and action is called to
implement the step.
I am trying to put together a breadcrumb trail to represent the Wizard
flow, with some difficulty. It is not helped by the fact that one cannot
have multiple "mvcSiteMapNode"s in mvc.SiteMap with the same controller
and action. It seems to need the master controller name ie "Wizard" and
"Index" as opposed to the child controller name ie "Step1" and "Index".
So, on its own, this will work:
<mvcSiteMapNode title="Step1" controller="Wizard"
action="Index" preservedRouteParameters="id"
route="Wizard"/>
However I would like to do, for multiple wizard steps:
<mvcSiteMapNode title="Step1" controller="Wizard"
action="Index" preservedRouteParameters="id"
route="Wizard"/>
<mvcSiteMapNode title="Step2" controller="Wizard"
action="Index" preservedRouteParameters="id"
route="Wizard"/>
But the above will not work, unless there is another way to differentiate
these nodes.
Any wisdom appreciated!
Thanks.

No comments:

Post a Comment