How do I add a class to an @Html.ActionLink?

后端 未结 5 489
旧巷少年郎
旧巷少年郎 2020-12-01 09:29

I have two @Html.ActionLink\'s that I want to make look like buttons. I\'m able to make this happen with CSS but only if I use the #ID of the actio

5条回答
  •  臣服心动
    2020-12-01 10:07

    It worked when i use null

    @Html.ActionLink("Add User", "Create",null, new { @class = "btn btn-primary" })

    "Add User" is Button Text

    "Create" is actionName

    null

    new { @class = "btn btn-primary" } CSS used bootstrap class

提交回复
热议问题