SHARE
TWEET

Untitled

a guest Jun 16th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //VM
  3.  
  4.  
  5.  public class UserRoleVm
  6.     {
  7.         public ApplicationUser user {get;set;}
  8.  
  9.           public List<RolesViewModel> roles {get;set;}
  10.     }
  11.  
  12.  
  13.     public class RolesViewModel {
  14.     public string RoleId {get; set;}
  15.     public string NomeRole {get; set;}
  16.     public bool UsuarioPossuiRole {get; set;}
  17.  
  18.     public bool Selected {get;set;}
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. VIEW
  26.  
  27.  
  28.   <div class="form-group">
  29.                                           @for (var i = 0; i < Model.Roles.Count; i++)
  30.                                             {
  31.                                                <input type="checkbox" asp-for="@Model.Roles[i].Selected"  />
  32.                                                 <label asp-for="@Model.Roles[i].Selected">@Model.Roles[i].NomeRole</label>
  33.                                                  <input type="hidden" asp-for="@Model.Roles[i].RoleId" />
  34.                                                   <input type="hidden" asp-for="@Model.Roles[i].NomeRole" />    
  35.                                        
  36.            
  37.                                               }              
  38.                                         </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top