如何用<a> tag?</a>替换MVC3 Grid列ActionLink

时间:2012-02-04 17:00:58

标签: html asp.net-mvc-3

如何使用<a>标记替换MVC3网格列 ActionLink

grid.Column(format: (item) => Html.ActionLink("Delete", "Delete", new { id = item.ID }, new { @class = "delete-button" } ), style: "column-action")

1 个答案:

答案 0 :(得分:1)

我假设签名将允许IHtmlString。未经测试。

grid.Column(
      format: (item) => Html.Raw("<a href='/delete/"
                                 + item.ID 
                                 + "' class='delete-button'>Delete</a>"),
      style: "column-action"
);