1. 在下面这个视图中我们利用ajax弹框进行操作
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#roleModal" onclick="add();">
新增
</button>
<table class="table table-bordered">
<thead>
<tr>
<th>名称</th>
<th>备注</th>
<th>修改</th>
<th>删除</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.Name</td>
<td>@item.Remark</td>
<td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#roleModal" onclick="edit(@item.ID)">
修改
</button>
</td>
<td>
<button type="button" class="btn btn-primary" onclick="del(@item.ID)">
删除
</button>
</td>
</tr>
}
</tbody>
</table>
2.利用bootstrap样式单击新增、修改弹出模态框
<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">