【问题标题】:Html.ActionLink text stylingHtml.ActionLink 文本样式
【发布时间】:2015-01-27 09:30:01
【问题描述】:

我只想在我的 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一样的样式?

【问题讨论】:

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


【解决方案1】:

我会使用Url.Action

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

【讨论】:

    猜你喜欢
    • 2011-06-03
    • 2020-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多