vendredi 4 août 2017

How to get data after selecting check box when giving paging in MVC?

I have got stuck while doing a project in the check box section. I have given checkbox, it is multiple select check box. And when selecting checkbox the ID is passing to the controller, But I need along with this ID to pass all the details in that checked row, So I passed the value as hidden to pass to the controller. My main problem is that I have given paging with to display 10 rows on a page. so when I select the checkbox on the second page the data that given in the hidden field will only display the First page items. this is my problem. how can I get the second pages item then passing to the controller ?


controller:

public ActionResult Student(StudentViewModel studentViewModel, int? page)
        {
            try
            {
                    foreach (var result in studentViewModel.GetAllSelctedCheckBoxes)
                    {
                    }
                    return View("");
            }

            catch (Exception ex)
            {
            }
        }

view

@for (int i = 0;  i < Model.studentListPG.Count; i++)
                                    {
                                        <tr>
                                            <td style="text-align:center;">
                                                <input type="checkbox" id="ID" class="check1" name="GetAllSelctedCheckBoxes"  value="@Model.studentListPG[i].ID" />
                            @Html.HiddenFor(q => q.Date)
                            @Html.HiddenFor(q => q.studentList[i].ID)
                            @Html.HiddenFor(q => q.studentList[i].div
                            @Html.HiddenFor(q => q.studentList[i].Name)

                                            </td>

This is my problem. Can anyone please help me to find a solution for this problem ?? Or is it a good way to write script to pass values to controller

Can't find check box with paging




Aucun commentaire:

Enregistrer un commentaire