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.
31 lines
793 B
31 lines
793 B
<ul class="nav navbar-nav">
|
|
<li class="@GetClass("Home")">
|
|
<a href="@Url.Action("Index","Home")">
|
|
首页
|
|
</a>
|
|
</li>
|
|
<li class="@GetClass("Device")">
|
|
<a href="@Url.Action("Index","Device")">
|
|
设备
|
|
</a>
|
|
</li>
|
|
<li class="@GetClass("Device")">
|
|
<a href="@Url.Action("Test","Home")">
|
|
Test
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
@functions{
|
|
public string GetClass(params string[] controllers)
|
|
{
|
|
if (controllers.Select(o => o.ToLower()).Contains(this.ViewContext.RouteData.Values["controller"].ToString().ToLower()))
|
|
{
|
|
if (controllers.Length > 1)
|
|
{
|
|
return "active open";
|
|
}
|
|
return "active";
|
|
}
|
|
return "";
|
|
}
|
|
} |