I recently attempted to delve into the AjaxContext utilized by ASP.NET-MVC in scenarios such as Ajax Actionlinks and their clientside functions like onSuccess and onComplete. However, I must admit that I found it quite confusing... Is there any documentation available to explain this further?
Can anyone offer guidance on how to access the 'target' or 'srcElement' (e.target or window.event.srcElement) within a onSuccess or onComplete javascript event?
<%=Ajax.ActionLink(
"LinkText", "Action", New With {.Controller = "ControllerName"},
New AjaxOptions With {
.UpdateTargetId = "divElement",
.OnSuccess = "function(ajaxContext) {console.log(ajaxContext);}"
}) %>
This code snippet produces the following HTML:
<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>