问题
How do I add a css class to this actionlink? I have read you do it something like new { class = button }
but I'm not sure where to put it within my actionlink:
<%= Html.ActionLink("View Performances", "Details", "Productions",
new { name = item.show , year = item.year }, null) %>
回答1:
you can try
<%= Html.ActionLink("View Performances", "Details", "Productions",
new { name = item.show , year = item.year },
new {@class = "button"}) %>
来源:https://stackoverflow.com/questions/5608622/asp-net-mvc-add-css-class-to-actionlink