Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to get and set checkbox list in ASP.NET Core

$
0
0

Hello.

I have 3 tables :

Roles : Id, Name

Permissions : Id, Title

RolePermissions : Id, RoleId, PermissionsId

And one RolePermissionViewModel : string RoleName  -  List<Permissions> RolePermissions

Ok, then i have a view to list all roles, each role can be edit, when click on edit button redirects to /Edit/RoleId View, in this view I expect RolePermissionsViewModel

in this view by getting role id i can get list of Permissions that belongs to this role (in RolePermission Table i get list of records that RoleId field is RoleId that i passed to view by url)

+++++ 1- Now i want to list all Permissions and check Permissions that are exist in Mode.RolePermissions.

+++++ 2- I want to know how can i edit RolePermissions by getting checked checkboxes (User can check or uncheck Permissions and save form)

Please help me in this, this is very important to me. Thanks alot.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>