Html.ActionLink文本样式

时间:2015-01-27 09:30:02

标签: html asp.net-mvc html-helper html.actionlink

我想在ActionLink中仅设置部分文本样式,我需要加号为粗体。在纯HTML中,我可以这样做。

<a class="topMenu" href="#"><span style="font-weight:bold;">+</span>Invite User</a>

如果使用ActionLink尝试这样:

@Html.ActionLink("<span style="font-weight:bold;">+</span>Invite User", "Invite", "Account", new { @class = "topMenu" })

它被渲染为原样,就像一行文字一样。

是否可以像纯HTML一样设置样式?

1 个答案:

答案 0 :(得分:1)

我会使用Url.Action

<a class="topMenu" href="@Url.Action("Invite", "Account")">
    <span style="font-weight:bold;">+</span>Invite User
</a>
相关问题