I am doing this project in mvc .net and i cant get the delete button to work for some reason. Basically clicking on it does nothing. I want to delete an item from the database. Can someone help me fix this?
the complete table that i was asked to add:
<body style="background-color:ghostwhite; ">
<table id="tableid" style="float: left; margin-top: 5%; margin-left: 5%; border:1px solid black; width: 720px; height: auto; background-color: white">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Quantity)
</th>
<th>
@Html.DisplayNameFor(model => model.Price)
</th>
@if (User.IsInRole("Pharmacist"))
{
<th>
Order
</th>
}
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Quantity)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@if (User.IsInRole("Administrator"))
{
@Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-info" })
<button data-id="@item.Id" class="btn btn-warning js-delete">Delete</button>
}
@if (User.IsInRole("Pharmacist"))
{
@Html.BeginForm("Order1", "Medicines")
{
@item.Id<input type="checkbox" name="selectedNames" value="@item.Id" />
}
}
</td>
</tr>
}
</tbody>
</table>
@if (User.IsInRole("Pharmacist"))
{
<button class="btn btn-default" value="Order">Generate receipt</button>
}