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

人走茶凉 提交于 2019-12-18 12:47:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!