0

I have a checkbox in list and it fill dynamically from database, after fill the list when i submit the form all the details passing to the model class except Checkbox value.

 @if (Model.FeeInstallmentList != null)
                    {
                        for (int i = 0; i < Model.FeeInstallmentList.Count; i++)
                        {
                            <tr>

                                                               <td>@Html.CheckBoxFor(model => model.FeeInstallmentList[i].CheckInstallment, new { @Name = "checkInstallment", @id = "checkInstallment" + i ,@class
                                 = "checkInstallment"})</td>
                                <td>@Html.DisplayFor(model => model.FeeInstallmentList[i].NoOfInstallment)</td>
                                <td>@Html.DisplayFor(model => model.FeeInstallmentList[i].InstallmentAmount)</td>
                                <td>@Html.DisplayFor(model => model.FeeInstallmentList[i].FromDate)</td>
                                <td>@Html.DisplayFor(model => model.FeeInstallmentList[i].Todate)</td>
                                <td>@Html.DisplayFor(model => model.FeeInstallmentList[i].Status,new { @id = "Status"})</td>
                            </tr>
                        }
                    }
  • Anyone who can solve this problem? – Pankaj Sharma Feb 24 '16 at 06:26
  • Not sure if this answer is too late, but I had a similar issue and had it to work with the solution here. Not sure if it is the best way though. http://stackoverflow.com/questions/36855481/in-mvc-6-how-to-code-checkbox-list-in-view-and-pass-the-checked-values-to-the-c/36875727#36875727 – niki b Apr 26 '16 at 21:14

0 Answers0