Nauman.Khattak
Nauman.Khattak

Reputation: 641

how to Assign roles to User while creating their account

i am using asp.net built-in membership and role provider.

In my application Admin Create account for user.

currently i am assigning roles by going to asp.net configuration website.

kindly tell me how to add an extra step of Select Role in creat user account API.

Thanks.

Upvotes: 5

Views: 6662

Answers (2)

djdd87
djdd87

Reputation: 68506

Are you just asking how to assign a User to a Role?

Roles.AddUserToRole(userName, roleName);

And to remove a role:

Roles.RemoveUserFromRole(userName, roleName);

Upvotes: 8

Related Questions