This is a migrated thread and some comments may be shown as answers.

Binding to sitemap MVC

1 Answer 216 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 23 Oct 2012, 02:39 PM
I am using MVC4 C# and Kendo UI version 2012.2.913.340.  I followed the kendo UI example for creating a menu that binds to the sitemap.xml.  However my menu does not populate the data from my site map.  I'm not sure why this would not be working.

My View: 
@(Html.Kendo().Menu()
                    .Name("XmlMenu")
                    .BindTo("WebSiteMap"))


My controller:
public ActionResult Index()
        {


            if (!SiteMapManager.SiteMaps.ContainsKey("WebSiteMap"))
            {
                SiteMapManager.SiteMaps.Register<XmlSiteMap>("WebSiteMap", sitemap => sitemap.LoadFrom("~/Web.sitemap"));
            }                                                                                   

            return View());
        }

Has anyone else had this issue?  

1 Answer, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 23 Oct 2012, 07:37 PM
I found the issue.  I am using this in a project that has MVC and webforms side by side, and it did not like the webforms elements.
Tags
Menu
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Share this question
or