I have a Kendo PanelBar and Menu declared in my MVC Layout and they slow down my page render by about 10 seconds each. These used to be Telerik controls for MVC 3, and I made minimal code changes to convert them to the Kendo controls for MVC 5. The old Telerik version does not experience these slow load times. I know that my PopulateSiteMapAttribute is not the issue, as that code takes 0 seconds to run. Can you give me any clues as to what might be causing this slowness?
If I remove this block from my MVC Layout, the page renders 20 seconds faster:
@{ Html.Kendo().Menu()
.Name("TopNavigation")
.HtmlAttributes(new { @class = "topNavigation" })
.BindTo("PA.web.mvc.sitemap", (item, node) =>
{
if (!string.IsNullOrEmpty(node.ControllerName) && !string.IsNullOrEmpty(node.ActionName))
{
item.ControllerName = node.ControllerName.ToLower();
item.ActionName = node.ActionName.ToLower();
item.Text = node.Title.Substring(0, node.Title.IndexOf("|"));
item.HtmlAttributes.Add("class", node.Title.Substring(node.Title.IndexOf("|") + 1));
}
})
.Render();
}