asp.net mvc批量删除的实现
<form action="Index" method="post">
<div>
@{
<table>
<thead>
<tr>
<th width="100">
編號
</th>
<th width="100">
名字
</th>
</tr>
</thead>
<tbody>
foreach (var item in Model)
{
<tr >
<td><input type="checkbox" value="@item.id" name="checkedId"/></td>
<td>@item.Name</td>
</tr>
}
</tbody>
</table>
}</div>
<div>
<input type="submit" value="刪除"/>
</div>
</form>
#region 批量刪除
[Authorize]
[HttpPost]
public ActionResult Index(string[] checkedId)
{
if (checkedId != null)
{
string strIds = string.Join(",", checkedId.Cast<string>().ToArray());
DAL.BatchDelete(strIds)
return View();
}
}
轉載于:https://www.cnblogs.com/Builder/archive/2012/05/26/2519428.html
總結
以上是生活随笔為你收集整理的asp.net mvc批量删除的实现的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android中的Handler, Lo
- 下一篇: ASP.NET生成WORD文档服务器部署