Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The node the DynamicNode is declared on is just a template node. That node will not be added to the SiteMap. Furthermore, any properties that you set on the DynamicNode objects within your provider will overwrite what you have defined on the template node.</p> <p>In your example, the "KeyOfParentDbNode" value will be overwritten by the value "KeyOfParentNode" in every case, which could be the source of your problem. Also, be sure there is a node somewhere that sets the key property explicitly to "KeyOfParentNode" (that is, if "KeyOfParentNode" is what you intended to set).</p> <p>In addition, the Clickable property will be set to false for all of your DynamicNodes.</p> <p>If you are using 4.3.0 or higher, the order doesn't matter because the SiteMapNodeProviders instantiate all of the nodes before the SiteMapBuilder adds them to the SiteMap so all of the parent nodes are all available at that point in time.</p> <p>It is often helpful to use a <code>@Html.MvcSiteMap().SiteMap()</code> HTML helper to view the nodes to see if they are nested correctly. You could also check by calling <code>MvcSiteMapProvider.SiteMaps.Current.FindSiteMapNodeFromKey("TheDynamicNodeKey")</code> to see if the controller and action (and other) properties are being set correctly (although in your example it should be fine).</p> <p>Another issue you might be having is that MvcSiteMapProvider uses strings when doing the comparison and you are setting the "id" to a Guid.</p> <pre><code>// You have dynamicNode.RouteValues.Add("id", profile.IdProfile); // Should be dynamicNode.RouteValues.Add("id", profile.IdProfile.ToString()); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload