You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
855 B
27 lines
855 B
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
|
<li class="nav-item">
|
|
<a href="@Url.Action("Index","Account")" class="@getLinkClass("Home")">
|
|
<i class="far fa-circle nav-icon"></i>
|
|
<p>
|
|
个人中心
|
|
</p>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
@functions{
|
|
public string getLinkClass(string controller = "Home",string action = null)
|
|
{
|
|
var currentController = ViewContext.RouteData.Values["controller"]?.ToString();
|
|
var currentAction = ViewContext.RouteData.Values["action"]?.ToString();
|
|
var cls = "nav-link";
|
|
if(controller==currentController)
|
|
{
|
|
if(action==null||action==currentAction)
|
|
{
|
|
cls+=" active";
|
|
}
|
|
}
|
|
return cls;
|
|
}
|
|
}
|