過去数時間検索してきましたが、残念ながら、.netとMVCを使用してデータテーブルにアクションの編集と削除のリンク列を入力する方法の例が見つからないようです。
これが私がこれまでに持っているものです、どうすればアクションリンクを追加できますか?私は何が欠けていますか?
<script type="text/javascript">
$(document).ready(function () {
$('#myDataTable').dataTable({
bProcessing: true,
sAjaxSource: '@Url.Action("Index1", "Default1")'
});
});
</script>
<div id="container">
<div id="demo">
<table id="myDataTable">
<thead>
<tr>
<th>
RoleId
</th>
<th>
RoleName
</th>
<th>
UserId
</th>
<th>
UserName
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
これを最後の列に追加したいと思います。
<td>
@Html.ActionLink("Edit", "Edit", new {id=item.PrimaryKey}) |
@Html.ActionLink("Details", "Details", new { id=item.PrimaryKey }) |
@Html.ActionLink("Delete", "Delete", new { id=item.PrimaryKey })
</td>
しかし、それを行う方法を理解することはできません。