I want to write a event of checkboxfor by when I click to checkbox It'll send data to controller and update status true/false
checkboxfor display on each row
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.PGId)
</td>
<td>
@Html.CheckBoxFor(modelItem => item.Status)
</td>
</tr>
}
<script>
// write a checkbox click event call to controller UpdateStatus
</script>
my controller UpdateStatus
[HttpPost]
public JsonResult UpdateStatus()
{
// code update status
}
Aucun commentaire:
Enregistrer un commentaire