Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd dynamic nodes to sitemap
    primarykey
    data
    text
    <p>I have a breadcrumb that loads its basic nodes from the DB (thx to nightowl for the help!). To archieve this functionality i implemented a 'CustomSiteMapNodeProvider' that implements 'ISiteMapNodeProvider'. The breadcrumb now works for the nodes that come from the DB. Now i wanted to add dynamic nodes as children of some nodes that came from the DB. My first impulse was to use the MvcSiteMapNodeAttribute.</p> <pre><code>[MvcSiteMapNodeAttribute(Title = "Execute", Area = "MyArea", DynamicNodeProvider = "My.Namespace.MyDynamicNodeProvider, My.Assembly", Clickable = false, ParentKey="KeyOfParentDbNode")] public ActionResult Execute(Guid id, MyViewModel vm){ return View(vm) } </code></pre> <p>But this didnt work, the Breakpoint inside 'MyDynamicNodeProvider' got hit at startup, but the breadcrumb isnt shown when i call the 'Execute' method.</p> <p>Here is how my DynamicNodeProvider looks like:</p> <pre><code>public class ProfileDynamicNodeProvider : DynamicNodeProviderBase { public override IEnumerable&lt;DynamicNode&gt; GetDynamicNodeCollection(ISiteMapNode node) { ProfileDao dao = DependencyResolver.Current.GetService&lt;ProfileDao&gt;(); // Create a node for each element foreach (Profile profile in dao.GetAll()) { DynamicNode dynamicNode = new DynamicNode { Title = profile.Name, //Key = "Profile_"+profile.IdProfile, ParentKey = "KeyOfParentNode", }; dynamicNode.RouteValues.Add("id", profile.IdProfile); yield return dynamicNode; } } } </code></pre> <p>What can i do to make this work?</p> <p>edit: could it be, that they are processed in the wrong order? i reach the breakpoint of my DynamicNodeProvider before i reach the breakpoint of the CustomSiteMapNodeProvider.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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