I'm using the Ajax.ActionLink helper to generate a link to delete a record. This is the code:
Ajax.ActionLink("Delete Image", "DeleteImage", new { id = item.Id },
new AjaxOptions { HttpMethod = "Delete", OnSuccess = "Test()" } )
I'm assign a Javascript function (Test()) to the OnSucess property because I want to do some JQuery stuff, but when I click the Delete link this error message is raised
Microsoft JScript runtime error: 'b' is null or not an object
in the MicrosoftAjax.js file (Line 5, Column 62099). If I remove the OnSuccess property, everything works fine (even if the Test() function is empty, the same error is raised). Thanks for your help!
OnSuccess = "Test()"
you have to write it like this it is a callback...
OnSuccess = "Test"
If you have to pass any parameter to the OnSuccess event you may have to write the funcion in this way.
OnSuccess = "function(){exampleFunction('" + param1 + "');}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With