This question is locked. New answers and comments are not allowed.
Hello,
in the attached sample is use multiple checkboxes and post this as list to the action method. in a normal form the asp.net modelbinder binds the values from the checkboxes as int array to the action parameter.
if i try this inside the grid, nothing will bound. please can you provide a working sample for this issue?
Regards,
Timo
in the attached sample is use multiple checkboxes and post this as list to the action method. in a normal form the asp.net modelbinder binds the values from the checkboxes as int array to the action parameter.
[HttpPost] public ActionResult Save( MyModel model, int[] events ) { // events is not empty }if i try this inside the grid, nothing will bound. please can you provide a working sample for this issue?
[GridAction] [HttpPost] public ActionResult _Save( MyModel model, int[] events ) { // events is empty }<h1>Editor for Events</h1> <table> <tbody> <tr> <td><input value="1" type="checkbox" name="Events" />Event 1</td> <td><input value="2" type="checkbox" name="Events" />Event 2</td> <td><input value="3" type="checkbox" name="Events" />Event 3</td> <td><input value="4" type="checkbox" name="Events" />Event 4</td> </tr> </tbody> </table>Regards,
Timo