我正在尝试使用 html 特殊字符 ×显示 ×。
在我的 Razor View 中使用以下代码
@Ajax.ActionLink("×", "LogTable", "Log", null, null, null)
但是上面的内容不能识别 ×作为一个特殊字符,而不是作为一个字符串,它显示 ×而不是×。有没有一种特定的方法来逃避它,所以它的工作原理如下
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
谢谢
最佳答案
您应该使用HttpUtility.HtmlDecode功能:
@Ajax.ActionLink(HttpUtility.HtmlDecode("×"), "LogTable", "Log", null, null, null)
关于c# - 在 ajax ActionLinks 中使用 ×,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27980606/