I'm creating a project for my institute. Using Asp.net MVC, I need multiple delete option with selected checkbox.
I have added a check in my view, but not delete multiple Raw. I don't want to use third party plugin. Please help me.
<table class="table table-striped table-condensed table-bordered">
<tr>
<th>
Select
</th>
<th>
@Html.ActionLink("Book Id", "Index", new { sortOrder = ViewBag.IdSortParm, currentFilter = ViewBag.CurrentFilter })
</th>
<th>
@Html.ActionLink("Title", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
</th>
<th>
@Html.ActionLink("Date", "Index", new { sortOrder = ViewBag.DateSortParm, currentFilter = ViewBag.CurrentFilter })
</th>
<th>
Price
</th>
<th>
Category
</th>
<th class="text-center">
Photo
</th>
<th>
User
</th>
<th>Edit</th>
<th>Delete</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
<input type="checkbox" name="deleteInputs" value="@item.BookId" />
</td>
<td>
@Html.DisplayFor(modelItem => item.BookId)
</td>
<td>
@Html.ActionLink(item.BookTitle, "Details", new
{
id = item.BookId
})
</td>
<td>
@Html.DisplayFor(modelItem => item.PublishDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.DisplayFor(modelItem => item.Category)
</td>
<td class="text-center">
<img class="img-thumbnail" width="50" height="50" src="~/ContentImages/Full/@item.Photo" />
</td>
<td>
@Html.DisplayFor(modelItem => item.UserName)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.BookId })
</td>
<td>
@Html.ActionLink("Delete", "Delete", new { id = item.BookId })
</td>
</tr>
}
</table>