我正在使用 MVC 4(剃刀)。我的 HTML 设计包含一个菜单(使用某种 javascript 组件),我正在寻找一种聪明的方法来用我当前所在的页面标记菜单。
<li class="glyphicons home currentScroll active"><a href="index.html?lang=en"><i></i><span>Dashboard</span></a></li>
<li class="glyphicons charts"> <a href="@Url.Action("Index", "Campaigns")"><i></i><span>Campaigns</span></a> </li>
<li class="glyphicons sort"> @Html.ActionLink("Home", "Index", "Home")</li>
<li class="glyphicons picture"> <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
如您所见,li
标记了活动,如果我想在_layout.cshtml
页面中使用此菜单,如何根据我当前正在加载的页面更改活动标记?