2014-01-29 51 views
2

如何向此@ Html.ActionLink添加類?我已經嘗試了很多建議,迄今爲止還沒有任何建議。將類添加到@ Html.ActionLink

     @Html.ActionLink("Physician Profile", 
            "Print", 
            "Roster", 
            new { profilePrintType = ProfilePrintType.PhysicianProfile}, 
            new { style="padding:2px 10px;" }) 

回答

3

你必須添加@

new { @style="padding:2px 10px;", @class = "className" }) 
+0

謝謝,我是想添加一個新行如新{@class =「類名」},並得到錯誤保留字。 –

2
@Html.ActionLink("Physician Profile", 
    "Print", 
    "Roster", 
    new { profilePrintType = ProfilePrintType.PhysicianProfile}, 
    new { style="padding:2px 10px;", @class = "some-css-class" })