我是asp.net或mvc开发的新手,我试图将静态html模板转换为asp.net mvc
我在菜单项的布局页面中有代码
在静态网站中我可以轻松粘贴class =" active"对于特定页面突出显示特定选项卡,因为我们必须为每个静态页面重复相同的代码,但我不知道如何在MVC中执行此操作,其中我们只有一个布局用于所有操作。
答案 0 :(得分:0)
见下文
@Html.ActionLink("linkText",
"Action",
"Controller",
new { /*routing values, leave empty if nothing specific*/ },
new { @class = "active" /*all html attributes (id, style, rel, etc) goes here*/ })