0
I’m trying to create a @Html.ActionLink
dynamic with Jquery but I’m not getting, how to do it ?
$('#tableView > tbody').empty();
if (data["CategoriaProduto"].length > 0) {
$.each(data["CategoriaProduto"], function (i, cp) {
var editLink = $('@Html.ActionLink("Edit", "edit", "CategoriaProduto"), new {id = ' + cp.id + '}');
$('#tableView > tbody:last-child').append('<tr>'
+ '<td class="text-capitalize small">' + cp.descricao + '</td>'
+ '<td class="col-md-1">' + editLink + '</td>'
+ '</tr>');
});
}
This code is inside a JS file or is in the view?
– goenning
@goenning inside a JS file, I can fill the table with
cp.descricao
, but I’m unable to create the@Html.ActionLink
– FernandoPaiva