Advice on Route Values-Dependant Sitemap

Apr 23, 2011 at 7:29 PM

Hi!

So, I'm developing an application using MVC3. I have one MailController with a List action. Mail can be Incoming or Outgoing, defined by the typeMode route value. How can I generate nodes for Incoming and for Outgoing? I tried implementing a dynamic provider but seems like any breakpoint in the class never hits and the breadrumb just collapses with no nodes.

Thanks.

Coordinator
Apr 27, 2011 at 7:19 AM

If your action is:

ActionResult List(string type)

where type can be "Incoming" or "Outgoing", add nodes as follows:

<mvcSiteMapNode title="Incoming emails" controller="Mail" action="List" type="Incoming" />

<mvcSiteMapNode title="Outgoing emails" controller="Mail" action="List" type="Outgoing" />