I'm using @Html.MvcSiteMap().SiteMapPath()
to build breadcrumbs trail.
I have two controllers, one is DealsController which inherited from class of DealsContorllerBase. The both classes has their own Index() methods, where child's Index() overrides Index() of parent class. In my Mvc.sitemap:
<mvcSiteMapNode title="Deals" controller="Deals" action="Index" >
<mvcSiteMapNode title="Deal" controller="Deals" action="ShowSpecificDeal" />
</mvcSiteMapNode>
In RegisterRoute function:
...
routes.MapRoute(
"Deals", // Route name
"Deals", // URL with parameters
new { controller = "Deals", action = "Index" }, // Parameter defaults
new[] { "InvestX.UI.Web", "InvestX.UI.Controllers" } // namespaces
);
...
The DealsController defined inside "InvestX.UI.Web" project and DealsControllerBase defined inside of "InvestX.UI.Controllers" project.
The whole exception as this:
Ambiguous controller. Found multiple controller types for 'DealsController'. The types that matched are:
InvestX.UI.Web.Controllers.DealsController InvestX.UI.Controllers.DealsControllerBase`1
Consider narrowing the places to search by adding your controller namespaces to ControllerBuilder.Current.DefaultNamespaces or exluding namespaces by adding them to the areaNamespacesToIgnore parameter of ControllerTypeResolverFactory.
I know if the DealsController were not inherited from DealsControllerBase and just use DealsController, everything would be fine. The exception was caused by which Index() action to take: DealsController's or DealsControllerBase's. My question is how does mvcSiteMapNode handle parent/child controller hierarky like this?