2015-07-02 78 views
0

我有以下操作鏈接,它將轉到視圖中的特定節。如何將類和樣式添加到路由到節的HTML.ActionLink

@Html.ActionLink("Morn Info", "Solutions", "Home", null, null, "EOB",null, null) 

如何添加一個風格和類這個Html.ActionLink,使它看起來像一個button

我覺得我可以添加...

new { @class = "button btn-flat", @style = "border-radius: 14px;" } 

,但我不能讓它這樣工作...

@Html.ActionLink("Early Out Billing", "Solutions", "Home", new { @class = "button btn-flat", @style = "border-radius: 14px;" }, null, "EOB", null, null) 

回答

1

htmlAttributes是在你的ActionLink的構造函數中的最後一個值。

@Html.ActionLink("Morn Info", 
"Solutions", 
"Home", 
null, 
null, 
"EOB", 
null, 
new { @class = "button btn-flat", @style = "border-radius: 14px;" })