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.
19 lines
622 B
19 lines
622 B
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link @GetClass("Index","Home")" href="@Url.Action("Index","Home")">首页</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link @GetClass("Nodes","Home")" href="@Url.Action("Nodes","Home")">节点</a>
|
|
</li>
|
|
</ul>
|
|
@functions{
|
|
public string GetClass(string action, string controller)
|
|
{
|
|
if (this.ViewContext.RouteData.Values["action"].ToString() == action &&
|
|
this.ViewContext.RouteData.Values["controller"].ToString() == controller)
|
|
{
|
|
return "active";
|
|
}
|
|
return "";
|
|
}
|
|
} |