Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 in a page. so when I select the checkbox in the second page the datas 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 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

What I have tried:

Cant find checkbox with paging
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900