I have the following Ajax ActionLink code:
render: function (data, type, row) {
return '@Ajax.ActionLink("Confirm", "Edit", "ResidencyConfirmation",
new { Id = data, ApplicationId = row.Id },
new AjaxOptions { UpdateTargetId = "SubItemContainer",
OnSuccess = "onShowSubItemSuccess",
InsertionMode = InsertionMode.Replace },
new { @class = "btn btn-primary" })';
}
This code is supposed to render buttons called "Confirm" in a jQuery datatable column. When one of the "Confirm" buttons is clicked, it is supposed to pass two Id parameters and then display a modal dialog. This functionality works if I hardcode the Ids, such as Id = new Guid("guid-value-here"), row.Id = new Guid("guid-value-here")
The challenge is that I am unable to pass the data and row.Id values as parameters.
I have been successful at passing data and row.x parameters using Url Actions, such as the following example:
render: function (row) {
var applicationDetails = '@Url.Action("Details", "Application")/' + row.Id;
return '<a href=\"' + applicationDetails + '\" class=\"btn btn-info\ fa fa-folder-open"></a>';
How can I convert my Ajax ActionLink to a Url Action or something similar to perform the same functionality?