NullReferenceException in GetNodeLevel

Nov 14, 2010 at 6:11 PM

When using the .Menu() - Helper with Startinglevel / MaxDepth, I always get a NullReferenceException in MvcSiteMapProvider.SiteMapNodeExtensions.GetNodeLevel.
(Parameter current is null)

CallStack:

> MvcSiteMapProvider.DLL!MvcSiteMapProvider.SiteMapNodeExtensions.GetNodeLevel(System.Web.SiteMapNode current = null) Line 24 + 0x3 bytes C#
> MvcSiteMapProvider.DLL!MvcSiteMapProvider.Web.Html.MenuHelper.GetNodeAtLevel(System.Web.SiteMapNode startingNode = null, int level = 2) Line 362 + 0x8 bytes C#
> MvcSiteMapProvider.DLL!MvcSiteMapProvider.Web.Html.MenuHelper.GetStartingNode(System.Web.SiteMapNode currentNode = null, int startingNodeLevel = 2) Line 342 + 0xb bytes C#
> MvcSiteMapProvider.DLL!MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapProvider.Web.Html.MvcSiteMapHtmlHelper helper = {MvcSiteMapProvider.Web.Html.MvcSiteMapHtmlHelper}, int startingNodeLevel = 2, bool startingNodeInChildLevel = true, bool showStartingNode = true, int maxDepth = 5) Line 103 + 0x1e bytes C#
> App_Web_04heaiwo.dll!ASP.views_shared_site_master.__Render__control1(System.Web.UI.HtmlTextWriter __w = {System.Web.UI.HtmlTextWriter}, System.Web.UI.Control parameterContainer = {ASP.views_shared_site_master}) Line 53 + 0x2f bytes C#

Coordinator
Nov 15, 2010 at 10:31 AM

What parameters are you passing in?

Nov 15, 2010 at 10:48 AM

My code is just <%=Html.MvcSiteMap().Menu(1,2) %>

Coordinator
Nov 15, 2010 at 1:14 PM

And ow does your sitemap look?