Hi, I think this is a pretty simple one, I want to restrict users to one role only. So I turned off Multiple in the roles dropdown in the Add Application User form. However when I select just one role, it does not show up as selected. I'm assuming this is because the identity model allows for multiple roles. So my question is how do I restrict my users to just one role in the Add/Edit Application User forms?
You can do the following:
Add User
- Disable multiple selection for roles DropDown
- Remove the expression for roles DropDown Value property
- Set page property to selected item in DropDown Change
- Set user.RoleNames before create in Form Submit event
Edit User
- Set page properly RoleName when you get the user in page load:
- Disable multiple selection for roles DropDown
- Remove the expression for roles DropDown Value property and bind it to RoleName page property
- Set user.RoleNames before create in Form Submit event
In this way you will get single role selection:
Thanks worked perfectly!