There is such a for according to the data:

 $.getJSON('http://165.179.215.237/auctions', function (data) { for (var i = 0; i < data.length; i++) { $('#auctions').append('<tr><td>' + data[i].branch + '</td><td>' + data[i].city + '</td><td>' + data[i].state + '</td><td>' + data[i].vehicles_remaining + " of " + data[i].vehicles + " remaining.." + '</td><td>' + data[i].status + '</td><td>' + @Html.ActionLink("connect", "Inventory", "Auctions", new { branchId = data[i].branch_code }, null) + '</td><tr>'); } }); 

in line

  @Html.ActionLink("connect", "Inventory", "Auctions", new { branchId = data[i].branch_code }, null) 

swears at data[i].branch_code

the name 'data' does not exist in the current context

How do I pass this value into actionlink ?

    1 answer 1

     $('#auctions').append('<tr><td>' + data[i].branch + '</td><td>' + data[i].city + '</td><td>' + data[i].state + '</td><td>' + data[i].vehicles_remaining + " of " + data[i].vehicles + " remaining.." + '</td><td>' + data[i].status + '</td><td>' + '<a href="Inventory/' + data[i].branch_code + '">connect</a>' + '</td><tr>'); } 

    Made without ActionLink