title: Asp.Net Mvc 4 SiteMap
body: <p>I want to add SiteMap in My Project But I still Got Error</p>
  
  <pre><code>Not all configured nodes could be paired with a parent node. Check your parent keys to ensure that a node with a corresponding key exists in the SiteMap. Note that the match is case sensitive.
  </code></pre>
  
  <p>Here is My Site Map</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0"
              xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0 MvcSiteMapSchema.xsd"&gt;
  
    &lt;mvcSiteMapNode title="Home" controller="Home" action="Index" key="Home"&gt;
      &lt;mvcSiteMapNode title="Quiz" controller="Quiz" action="Index" key="Quiz" dynamicNodeProvider="SiteMapExample.Models.DynamicNodeCategory,SiteMapExample" &gt;
  
      &lt;/mvcSiteMapNode&gt;
    &lt;/mvcSiteMapNode&gt;
  
  &lt;/mvcSiteMap&gt;
  </code></pre>
  
  <p>and here is My Model which Generate the Dynamic Node For SiteMap</p>
  
  <pre><code> public class DynamicNodeCategory : DynamicNodeProviderBase
      {
          public override IEnumerable&lt;DynamicNode&gt; GetDynamicNodeCollection(ISiteMapNode node)
          {
              string[]category={".Net","Java","C"};
              for (int i = 0; i &lt; 3; i++)
              {
                  DynamicNode dNode = new DynamicNode();
                  dNode.ParentKey = "Quiz";
                  dNode.Title = category[i];              
                  dNode.Action = "Test";
                  dNode.Controller = "Quiz";
                  dNode.Key = dNode.Title;
                  dNode.RouteValues.Add("category", dNode.Title);
                  yield return dNode;
              }
          }
      }
  </code></pre>
  
  <p>and i am using Sitemap here</p>
  
  <pre><code>@Html.MvcSiteMap().SiteMapPath()
  </code></pre>