【发布时间】:2015-10-26 01:26:03
【问题描述】:
经过一些研究,我无法从我的问题中找到一个好的答案。
我有一个辅助方法来创建带有“+”号和标签的操作链接:
public static HtmlString NewButton(this IHtmlHelper htmlHelper)
{
var htmlAttributes = new { @class = "btn btn-small btn-primary" };
return htmlHelper.ActionLink("Insert", "Create", null, new RouteValueDictionary(), htmlAttributes);
}
如何以我的最终 html 看起来像这样的方式包含“+”号?
<a href="/posts/new" class="btn btn-small btn-primary">
<i class="ace-icon fa fa-plus"></i>
Insert
</a>
在我的页面中,我像这样使用我的助手:
<div class="form-actions">
@Html.NewButton()
</div>
【问题讨论】:
标签: asp.net-mvc