I know that exists Ajax.ActionLink function, which signature like this:
@Ajax.ActionLink(
"click me",
"SomeAction",
"SomeController",
new AjaxOptions {
HttpMethod = "POST",
OnSuccess = "success"
}
)
And i can to attach my callback for example:
function success(data) {
var json = $.parseJSON(data.responseText);
alert(json.someProperty);
}
I know that html helpers is extension methods. Question: How to create custom html helper like Ajax.ActionLink in which i can specify callback function. Who can give me example how to make that extension method with ability to take callback function as parameter and execute it.
Here:
and then in your view you could call the helper: