多类ASP.NET MVC3的ActionLink [英] ActionLink with multiple classes in ASP.NET MVC3
本文介绍了多类ASP.NET MVC3的ActionLink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很好奇,是有可能在MVC3剃刀语法的ActionLink的使用多个CSS类?
线下似乎只加载第一类(BTN)和skipps btn_c。
@ Html.ActionLink(管理,索引,管理,空,新的{@class =BTN btn_c})
解决方案
我只是用你用下面的CSS现有ActionLink的:
.btn
{
颜色:黄色;
}.btn_c
{
背景色:红色;
}
和它成功生产出下面的输出:
I'm curious, is it possible to use multiple CSS classes on an ActionLink in MVC3 Razor syntax? The line below appears to load only the first class(btn) and skipps btn_c.
@Html.ActionLink("Administration", "Index", "Admin", null, new { @class = "btn btn_c" })
解决方案
I've just used your existing ActionLink with the following css:
.btn
{
color: yellow;
}
.btn_c
{
background-color: red;
}
And it successfully produced the following output:
这篇关于多类ASP.NET MVC3的ActionLink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文