Here is my example:
<ul>
<li><a href="GrandParent.html">Grand Parent</a>
<ul>
<li><a href="Parent.html">Parent</a>
<ul>
<li><a href="child.html">child</a></li></ul>
</li>
</ul>
</li>
</ul>
every li element has a anchor tag next to it (not shown in the code, please assume that).
Now if a select value "Child" from the above code then i should get the below result "Grand Parent/ Parent / Child" and if i select parent then i should get "Grand Parent / Parent"
So basically the i want to get parent with all its child
Here is my code:
@helper GetTreeView(Abacus_CMS.Models.AbacusModel siteMenu, int parentID)
{
var url = new System.Web.Mvc.UrlHelper(Context.Request.RequestContext);
foreach (var i in siteMenu.AbacusMenuList.Where(a => a.ParentCatagoryId.Equals(parentID)))
{
<li>
@{ var submenu = siteMenu.AbacusMenuList.Where(a => a.ParentCatagoryId.Equals(i.Id)).Count();}
@if (submenu > 0)
{
<li style="margin-left: -6px;">
<a href="@url.RouteUrl("GettingStarted", new { catname = HttpUtility.UrlEncode(i.Name.Replace(' ', '-'))})" id="@i.Name.Replace(' ', '-').ToLower()" onclick="GetParents()">
<i class="fa fa-chevron-right" aria-hidden="true"style="margin-left: 25px; font-size: 10px;">
</i><span class="title" style="margin-left: 0px;">@i.Name</span>
<span class="arrow " style="height: 4px;"></span>
</a>
<ul class="sub-menu">
@treeview.GetTreeView(siteMenu, i.Id)
@* Recursive Call for Populate Sub items here*@
</ul>
</li>
@*<span class="collapse collapsible"> </span>*@
}
else
{
<a href="@url.RouteUrl("GettingStarted", new { catname = HttpUtility.UrlEncode(i.Name.Replace(' ', '-')) })" style="margin-left: 30px;" id="@i.Name.Replace(' ', '-').ToLower()">
@i.Name
</a>
}
</li>
}
}
how to Get breadcrumb path as text??