i using datatables table plug-in jquery , having issue retrieving posting data between different pages.
so have checkbox in each row on table. if user selects checkbox on page 1 switches page 2 , selects checkbox , submits, controller receives blank object. if submit page 1 can see items first page. there way post whole table?
second issue, have 2 buttons @ bottom should 2 different things. either call method , determine button pressed or call specific method. how accomplish this?
razor code
@using (html.beginform("manageselected", "home", formmethod.post, new { id = "manageapplicationform" })) { <table id="example" class="table table-striped table-bordered table-condensed" width="100%"> <thead> <tr> <th> </th> <th>student name</th> </tr> </thead> <tbody> @for (var = 0; < model.students.count(); i++) { @html.hiddenfor(x => x.students[i].student.studentuserid) <tr> <td style="width: 1px">@html.checkboxfor(model => model.students[i].isselected)</td> <td>@model.students[i].student.user.fullname() </td> </tr> } </tbody> </table> <button type="submit" class="btn btn-primary btn-action" id="acceptbtn" value="accept" name="command">accept</button> <button type="submit" class="btn btn-primary" value="decline" name="command">decline</button> } controller stub
public actionresult manageselected(adminmanageapplicationsviewmodel model, string command)
Comments
Post a Comment