I'm trying to implement a treeview menu in my application and everything works fine except that once I click on an item in the expanded list, the reloaded page loads with the contracted list, which makes navigation difficult for users. What could be causing this? Is it the Html.Actionlink in my code? My code from the menu is below. Please explain what can be done here. Thanks in advance.
<li class="treeview">
<a href="#">
<span>Leave Management</span> <i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li class="@Html.IsActive("Leave", "Index")">@Html.ActionLink("My leave Information", "Index", "Leave")</li>
<li class="@Html.IsActive("Leave", "NewLeaveRequest")">@Html.ActionLink("New Leave Request", "NewLeaveRequest", "Leave")</li>
<li class="@Html.IsActive("Leave", "Approve")">@Html.ActionLink("Approvals", "Approve", "Leave")</li>
<li class="@Html.IsActive("Leave", "EmpLeaveInfo")">@Html.ActionLink("Employee Leave Information", "EmpLeaveInfo", "Leave")</li>
</ul>
</li>
<div class="container">
<div class="row">
<div class="col-sm-3">
<nav>
<ul class="nav">
<li><a href="#">Home</a></li>
<li>
<a href="#" id="btn-1" data-toggle="collapse" data-target="#submenu1" aria-expanded="false">Leave Management</a>
<ul class="nav collapse" id="submenu1" role="menu" aria-labelledby="btn-1">
<li>@Html.ActionLink("My leave Information", "Index", "Leave")</li>
<li>@Html.ActionLink("New Leave Request", "NewLeaveRequest", "Leave")</li>
<li>@Html.ActionLink("Approvals", "Approve", "Leave")</li>
<li>@Html.ActionLink("Employee Leave Information", "EmpLeaveInfo", "Leave")</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</div>
Here is a working example with data source BootStrap TreeView
A simple and elegant solution to displaying hierarchical tree structures (ie a Tree View)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.