将 CSS 应用到 Html.Action()

J86*_*J86 0 c# html-helper asp.net-mvc-3

我正在使用 ASP.net MVC3,如何将 CSS 类添加到@Html.Action(). 我已执行以下操作,但它不起作用:

@Html.Action("ProductEmailAFriendButton", "Catalog", new { productId = Model.Id, @class="test" })
Run Code Online (Sandbox Code Playgroud)

Raf*_*fay 5

@Html.ActionLink("ProductEmailAFriendButton", "Catalog", new { productId = Model.Id},new{@class="test",@id="someid", @style="background:none #fff";})
Run Code Online (Sandbox Code Playgroud)

在第四个参数中提供类,即 htmlattributes,希望您能明白