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
731 B
31 lines
731 B
<ul class="nav navbar-nav">
|
|
<li class="@GetClass("Home")">
|
|
<a href="@Url.Action("Index","Home")">
|
|
首页
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="@Url.Action("Test","Home")">
|
|
测试
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="/swagger/index.html">
|
|
Open API
|
|
</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 "";
|
|
}
|
|
} |