ASP.NET MVC将css类添加到actionlink

时间:2011-04-09 23:26:57

标签: asp.net-mvc actionlink

如何在此actionlink中添加css类?我已经读过你这样的事情new { class = button }但是我不确定把它放在我的动作链接中:

<%= Html.ActionLink("View Performances", "Details", "Productions", 
                    new { name = item.show , year = item.year }, null) %>

1 个答案:

答案 0 :(得分:82)

你可以尝试

<%= Html.ActionLink("View Performances", "Details", "Productions", 
        new { name = item.show , year = item.year }, 
        new {@class = "button"}) %>