【问题标题】:ActionLink italics certain portionActionLink 斜体部分
【发布时间】:2015-12-01 14:48:52
【问题描述】:

我喜欢在我的 MVC 视图中执行以下操作:

  @Html.ActionLink("How do <i>This</i>", "Vtd", "Crs", new { Text= Html.Encode("How it works"}, null) 

注意我希望 This 以斜体字作为超链接

【问题讨论】:

标签: asp.net-mvc


【解决方案1】:

Html.ActionLink() 而言,只渲染&lt;a href=".."&gt;&lt;/a&gt; 标签可能不是实现目标的最佳方式。

我相信你的情况最好像这样使用Url.Action() helper:

<a href="@Url.Action("Vtd", "Crs", new { Text= Html.Encode("How it works"}, null })">
    How do <i>This</i>
</a>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-26
    • 1970-01-01
    相关资源
    最近更新 更多