ASP.NET MVC添加CSS类的ActionLink [英] ASP.NET MVC add css class to actionlink
本文介绍了ASP.NET MVC添加CSS类的ActionLink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将css类添加到该ActionLink的?我看过你做的东西像新{类=按钮}
,但我不知道在哪里把它放在我的ActionLink的范围内:
<%= Html.ActionLink(查看表演,详细信息,生产,
新{名= item.show,一年= item.year},NULL)%GT;
解决方案
您可以尝试
<%= Html.ActionLink(查看表演,详细信息,生产,
新{名= item.show,一年= item.year},
新{@class =按钮})%GT;
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) %>
解决方案
you can try
<%= Html.ActionLink("View Performances", "Details", "Productions",
new { name = item.show , year = item.year },
new {@class = "button"}) %>
这篇关于ASP.NET MVC添加CSS类的ActionLink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文