dimanche 18 janvier 2015

How do I write a ajax event of checkbox to pass value Id immediately on row to controller

How can I pass value of PGId by click checkbox and get value of checkbox to update value.


my view



@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.PGId)
</td>
<td>
@Html.CheckBoxFor(modelItem => item.Status)
</td>
</tr>
}
<script>
// how can I write a ajax event of checkbox to pass value of PGId to controller
</script


my controller



[HttpPost]
public JsonResult ChangeStatus(string PGId)
{
// repository update status by PGId
}




Aucun commentaire:

Enregistrer un commentaire