Post checked checkboxes to controller action without using HTML helper like Html.CheckboxList

后端 未结 2 1817
无人及你
无人及你 2020-12-09 18:50

I have a list of items and I would like to delete items that are checked in a list of checkboxes.

I can\'t use something like CheckboxList since I\'m us

2条回答
  •  [愿得一人]
    2020-12-09 19:43

    If you want generated html like

    
    
    

    Then you can use the following code

    @Html.CheckBox("selectedItems", new { @value = @item.checkId }) 
    
         
    
    

    It won't pass selectedItems to controller.

提交回复
热议问题