有没有比我在下面实现一行导航链接的代码中更好的方法来跟踪所选项目。
@Html.ActionLink(
"PreApproval",
"Summary",
new { mode = "preapproval" },
new { @class = Model.Mode == "preapproval" ? "selected" : "notselected" }) |
@Html.ActionLink(
"ActionNeeded",
"Summary",
new { mode = (string)null },
new { @class = string.IsNullOrWhiteSpace(Model.Mode) ? "selected" : "notselected" }) |
...
我应该尝试封装菜单导航的功能还是这是一种标准方法?