我想将链接转换为 ajax 操作链接。我不知道如何在链接文本中显示 html 元素?
这是原始链接:
<a href="#onpageanchor" id="myId" class="myClass" title="My Title."><i class="icon"></i>Click Me</a>
这是ajax操作链接:
@Ajax.ActionLink("<i class='icon'></i>Click Me", "MyActionMethod", new { id = "testId" },
new AjaxOptions
{
UpdateTargetId = "mytargetid"
}, new
{
id = "myId",
@class = "myClass",
title="My Title."
})
呈现的链接文本是实际的字符串:"<i class='icon'></i>Click Me</a>"