在 ajax 个 ActionLinks 中使用 ×

Using × within ajax ActionLinks

我正在尝试使用 html 特殊字符 ×显示一个×.

在我的剃刀视图中使用以下代码

@Ajax.ActionLink("×", "LogTable", "Log", null, null, null)

但是上面的不识别 ×作为一个特殊字符而不是作为一个字符串,它显示 ×而不是×。有没有特定的方法来逃避它,所以它的工作原理如下

<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
        &times;
</button>

谢谢

您应该使用 HttpUtility.HtmlDecode 功能:

@Ajax.ActionLink(HttpUtility.HtmlDecode("&times;"), "LogTable", "Log", null, null, null)