I have to bind checkbox value and textbox value with model.Here I am using model to retrive and to post data as well. I have tried few options but it didnt work.
Below is my code:
@model IEnumerable<ALDS.Web.Areas.AR.Models.ReportViewModel>
@{
ViewBag.Title = "Standings";
}
<table class="table table-bordered">
<thead>
<tr>
<th>LR Date</th>
<th>LR Line No</th>
<th>Issue</th>
<th>Correction Response</th>
<th>Remarks</th>
<th>Submission</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@item.InsertDate
</td>
<td>
@item.LRLineID <a href="">View</a>
</td>
<td>Margin % incorrect</td>
<td><label for="cbox1">Corrected</label> <input type="checkbox" name="Corrected" value="@item.Status" /> <label for="cbox1">Neglected</label> <input type="checkbox" name="Neglected" value="@item.Status"/></td>
<td><input type="text" value="@item.Comments"/></td>
<td><a href="@Url.Action("Update","Error",Model)">Submit</a></td>
</tr>
}
</tbody>
</table>
I have to send the checkbox and textbox value to controller. Please help.