There's no @Html.Button !

后端 未结 5 1881
粉色の甜心
粉色の甜心 2020-12-04 14:55

this is weird. I see references out there for @Html.Button() but when I type that Intellisense doesn\'t find such a helper... there\'s dropdownlist, hidden, editors, et cet

5条回答
  •  猫巷女王i
    2020-12-04 15:40

    MVC5 , Bootstrap ver 3.2.0

    @Html.ActionLink
    (
        linkText: " Remove", 
        actionName: "Index", 
        routeValues: null, // or to pass some value -> routeValues: new { id = 1 },
        htmlAttributes: new { @class = "btn btn-success btn-sm glyphicon glyphicon-remove" }
    )
    

    This will generate a link that looks like a button.

提交回复
热议问题