role-manager

assign multiple roles for a user in aspnet identity

时光怂恿深爱的人放手 提交于 2019-12-13 02:08:18
问题 I have requirement to add multiple user roles for a particular user in user creation phase. So I'm going to achieve this using checkboxes in front end so this the viewpage @model project_name.Models.RegisterViewModel @{ } @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal"})) { <div class="form-group"> <label class="col-md-2 control-label"> Select User Role </label> <div class="col-md-10"> @foreach (var item in (SelectList)ViewBag.RoleId) { <input