New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
Sitemap Binding
Updated on Oct 28, 2025
The Menu enables you to create its items by binding to an ASP.NET sitemap, which automatically generates the hierarchical structure based on the XML sitemap configuration.
To bind the Menu to a sitemap, follow the next steps:
-
Create a simple sitemap with the
sample.sitemapfile name at the root of the project.xml<?xml version="1.0" encoding="utf-8" ?> <siteMap> <siteMapNode title="Home" controller="Home" action="Overview"> <siteMapNode title="Grid"> <siteMapNode controller="grid" action="index" title="First Look (Razor)" area="razor"/> <siteMapNode controller="grid" action="index" title="First Look (ASPX)" area="aspx"/> </siteMapNode> <siteMapNode title="Menu"> <siteMapNode controller="menu" action="index" title="First Look (Razor)" area="razor"/> <siteMapNode controller="menu" action="index" title="First Look (ASPX)" area="aspx"/> </siteMapNode> </siteMapNode> </siteMap> -
Load the sitemap using the
SiteMapManager.C#public ActionResult Index() { if (!SiteMapManager.SiteMaps.ContainsKey("sample")) { SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap => sitmap.LoadFrom("~/sample.sitemap")); } return View(); } -
Define the Menu and bind it to the sitemap.
Razor@(Html.Kendo().Menu() .Name("menu") // The name of the Menu is mandatory. It specifies the "id" attribute of the Menu's HTML element. .BindTo("sample") // Bind to the sitemap with the name "sample". )