Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC add css class to actionlink [duplicate]

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) %>
like image 874
Cameron Avatar asked Apr 09 '11 23:04

Cameron


1 Answers

you can try

<%= Html.ActionLink("View Performances", "Details", "Productions", 
        new { name = item.show , year = item.year }, 
        new {@class = "button"}) %>
like image 110
Bala R Avatar answered Nov 17 '22 21:11

Bala R