我试图检查 ASP.NET-MVC 使用的 AjaxContext,例如 Ajax Actionlinks 及其 onSucces、onComplete 等客户端函数。但是我不太了解它...关于这件事的文档在哪里?
当我处于 onSuccess 或 onComplete javascript 事件中时,有人知道如何获取“target”或“srcElement”(e.target 或 window.event.srcElement)吗?
<%=Ajax.ActionLink(
"LinkText", "Action", New With {.Controller = "ControllerName"},
New AjaxOptions With {
.UpdateTargetId = "divElement",
.OnSuccess = "function(ajaxContext) {console.log(ajaxContext);}"
}) %>
结果是:
<a
href="/Popout/ApplicationCodePopout"
onclick="Sys.Mvc.AsyncHyperlink.handleClick(
this, new Sys.UI.DomEvent(event),
{
insertionMode: Sys.Mvc.InsertionMode.replace,
updateTargetId: 'divElement',
onSuccess: Function.createDelegate(this,
function(ajaxContext) {console.log(ajaxContext);}
)
}
);"
>LinkText</a>