I have an Ajax.ActionLink
inside a PartialView
like so:
@Ajax.ActionLink(Model.IsVisible ? "Disable" : "Enable", "ToggleVisibility", "Review", new { area = "Admin", id = Model.Id }, new AjaxOptions { HttpMethod = "POST", OnComplete = "onComplete_AdminReviewOption" })
And the handling JavaScript function (declared in-line on the main View for now):
function onComplete_AdminReviewOption(ajaxContext) {
var jsonObject = ajaxContext.get_object();
}
Which throws a javascript error:
Object# has not definition for get_object()
.
I thought these JavaScript methods were part of the MicrosoftAjax.js
/ MicrosoftMvcAjax.js
scripts, both of which i have included on my page.
Can anyone confirm which library these helper methods are present?
I load the required scripts in my Layout.cshtml
file, then i do an AJAX call to render out the above PartialView.
So by the time i handle that function, the libraries are already loaded - which is why im confused.
Any ideas?