This question is locked. New answers and comments are not allowed.
I have this site map:
and this page:
and this Controller Action:
It is very close to the sample, but does not work. The first level items are shown, but the second level items not.
Previously I had a situation where the first first level item (Workstream) did not expand, but the second (Financial) did expand. But since then I have made some changes, and I do not know the exact condition. So the current symptom is, that the first level items do not expand.
What bothers me as well I do not understand the general flow of the samle code.
In the sample there is an action:
It is not in the Home Controller
It is not clear to me when in the general flow this action is called. It seems to me that this is a callback from the client, but I am not sure. With my project, the action is never called. What can I do to understand the general flow? Is there an overview chart for this?
By the way: What does [SourceCodeFile...] mean? What is it for?
| <?xml version="1.0" encoding="utf-8" ?> |
| <siteMap> |
| <siteMapNode title="Home"> |
| <siteMapNode title="Workstream"> |
| <siteMapNode controller="Workitem" action="Index" title="Workitems" /> |
| <siteMapNode controller="Sprint" action="Index" title="Sprints" /> |
| <siteMapNode controller="Chart" action="BurndownChicDiagram" title="Burndown Diagram" /> |
| </siteMapNode> |
| <siteMapNode title="Financial"> |
| <siteMapNode controller="Payment" action="Index" title="Payments" /> |
| <siteMapNode controller="RegularPayment" action="Index" title="Regular Payments" /> |
| <siteMapNode controller="Transaction" action="Index" title="Transactions" /> |
| <siteMapNode controller="Statement" action="Index" title="Statement" /> |
| <siteMapNode controller="MinMax" action="Index" title="Minimum Maximum Overview" /> |
| <siteMapNode controller="Chart" action="StatementChicDiagram" title="Statement Diagram" /> |
| <siteMapNode controller="Chart" action="MinMaxChicDiagram" title="Minimum Maximum Diagram" /> |
| </siteMapNode> |
| </siteMapNode> |
| </siteMap> |
and this page:
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> |
| <%@ Import Namespace="Telerik.Web.Mvc" %> |
| <% |
| if (ViewData["WorkstreamPlatform_WebRole.Menu"] != null) |
| { |
| Html.Telerik().PanelBar() |
| .Name("navigation-product-examples") |
| .HtmlAttributes(new { @class = "demos-navigation" }) |
| .BindTo("WorkstreamPlatform_WebRole.Menu") |
| .HighlightPath(true) |
| .ItemAction(item => |
| { |
| if (!item.Items.Any() && !string.IsNullOrEmpty(Request.QueryString["theme"])) |
| { |
| item.RouteValues.Add("theme", Request.QueryString["theme"]); |
| } |
| if (item.Selected) |
| { |
| item.HtmlAttributes["class"] = "active-page"; |
| } |
| if (item.Parent == null) |
| { |
| item.SpriteCssClasses = "t" + item.Text; |
| } |
| }) |
| .Render(); |
| } |
| %> |
and this Controller Action:
| [PopulateSiteMap(SiteMapName = "sample", ViewDataKey = "WorkstreamPlatform_WebRole.Menu")] |
| public ActionResult Index() |
| { |
| ViewData["Message"] = "Welcome to ASP.NET MVC!"; |
| if (!SiteMapManager.SiteMaps.ContainsKey("sample")) |
| { |
| SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap => sitmap.LoadFrom("~/Web.sitemap")); |
| } |
| return View(); |
| } |
It is very close to the sample, but does not work. The first level items are shown, but the second level items not.
Previously I had a situation where the first first level item (Workstream) did not expand, but the second (Financial) did expand. But since then I have made some changes, and I do not know the exact condition. So the current symptom is, that the first level items do not expand.
What bothers me as well I do not understand the general flow of the samle code.
In the sample there is an action:
| public partial class MenuController : Controller |
| { |
| [PopulateSiteMap(SiteMapName = "sample", ViewDataKey = "sample")] |
| [SourceCodeFile("Sitemap", "~/sample.sitemap")] |
| public ActionResult SiteMapBinding() |
| { |
| if (!SiteMapManager.SiteMaps.ContainsKey("sample")) |
| { |
| SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap => sitmap.LoadFrom("~/sample.sitemap")); |
| } |
| return View(); |
| } |
| } |
It is not clear to me when in the general flow this action is called. It seems to me that this is a callback from the client, but I am not sure. With my project, the action is never called. What can I do to understand the general flow? Is there an overview chart for this?
By the way: What does [SourceCodeFile...] mean? What is it for?