lundi 30 novembre 2020

Looping through table rows and getting the multiple checkbox values posted to controller in mvc

I have a 2D table being populated with respective roles of the members. Following is the structure of table Name|ReadRole|WriteRole|R/WRole ABC checkbox checkbox checkbox

Now there maybe n number of users in this table there will be a admin to manage the role access. So I need all the values of the respective users to be updated in DB when admin perform any changes. So I have written an javascript to read these values but the foreach loop is not working and I'm not able to post the data to controller. Can you please help me how can i pass a list from the view to the controller. Controller method is expecting List of UserRoles in the parameter from the View.

View code : will be in pictureCode snipt




Aucun commentaire:

Enregistrer un commentaire