I am having problems implementing the site map binding. I have scoured your example and don't understand how yours is working and mine isn't. Here is the code:
And in my Home Controller index method:
However I still get this error:
"You must have a SiteMap defined with key "WebSiteMap" in ViewData dictionary." I'm pretty sure that is what my code is doing so I don't understand why I would be getting this error.
Any thoughts?
Thanks!
@(Html.Kendo().Menu() .Name( "KendoMenu" ) .BindTo( "WebSiteMap"))And in my Home Controller index method:
if( !SiteMapManager.SiteMaps.ContainsKey( "WebSiteMap" ) ){ SiteMapManager.SiteMaps.Register<XmlSiteMap>( "WebSiteMap", sitemap => sitemap.LoadFrom( "~/Web.sitemap" ) );}However I still get this error:
"You must have a SiteMap defined with key "WebSiteMap" in ViewData dictionary." I'm pretty sure that is what my code is doing so I don't understand why I would be getting this error.
Any thoughts?
Thanks!