开发者

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

开发者 https://www.devze.com 2023-02-23 14:28 出处:网络
This question already has answers here: How do I add a class to an @Html.ActionLink? (5 answers) Closed 7 years ago.
This question already has answers here: How do I add a class to an @Html.ActionLink? (5 answers) Closed 7 years ago.

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", "Produc开发者_Python百科tions", 
                    new { name = item.show , year = item.year }, null) %>


you can try

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

精彩评论

暂无评论...
验证码 换一张
取 消