I have a menu generated with MvcSiteMapProvider using a helper for bootstrap and routing:
Controller Home:
[MvcSiteMapNode(Title = "Home", Key = "home")]
public ActionResult Index()
{
return View(model);
}
Controller Other:
[Route("mypageview", Name = "mypage")]
[MvcSiteMapNode(Title = "My Page", ParentKey = "home", Key = "mypage")]
public ActionResult mypage()
{
mymodel model = .....
return View(model);
}
Helper:
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@foreach (var node in Model.Nodes)
{
if (node.Children.Any())
{
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">@node.Title<strong class="caret"></strong></a>
<ul class="dropdown-menu">
@for (int i = 0; i < node.Children.Count; i++)
{
<li>@Html.DisplayFor(x => node.Children[i])</li>
}
</ul>
</li>
}
else
{
<li>
<a href="@node.Url" class="dropdown-toggle" data-toggle="dropdown">@node.Title</a>
</li>
}
}
</ul>
</div>
Layout View:
@Html.MvcSiteMap().Menu("BootstrapMenuHelperModel")
All of the menu items work perfectly and the dropdown menus too. They are all navigating to the correct locations. However the 'Home' button (first) of the menu does not navigate to index.
I have tried including index into the routing but that does nothing but break the website.