Binding to sitemap MVC

2 posts, 0 answers
  1. Michael
    Michael avatar
    2 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2012 Link to this post

    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?  
  2. Michael
    Michael avatar
    2 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2012 Link to this post

    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.
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top