【问题标题】:html entity in ActionLinkActionLink 中的 html 实体
【发布时间】:2016-01-11 12:07:04
【问题描述】:

如何在 ActionLink 中包含 html 实体。例如下面是»的情况。

<p>@Html.ActionLink("Link Text &raquo;", "Index", new { }, new { @class = "btn btn-warning", @role = "button" })</p>

【问题讨论】:

    标签: razor html-helper asp.net-mvc-views


    【解决方案1】:

    改用 Url.Action

    <p><a href=@Url.Action("Index") role="button"><span class="btn btn-warning">Link Text &raquo;</span></a></p>
    

    【讨论】:

      猜你喜欢
      • 2021-12-26
      • 2014-05-05
      • 2011-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多