Posted on: 10/30/2013 4:50:48 PM | Views : 1249

I am trying to implmement Simple Membership for my ASP.NET WebSite (WebForm) using Framework 4.5
I came across this article
http://www.asp.net/web-pages/tutorials/security/16-adding-security-and-membership
I was wondering how can I add users to roles and add roles programatically?
At the moment I am using this code to register a user, but dont' have any snippets to create roles and add users to a particular role
var userStore = new UserStore<IdentityUser>(); var manager = new UserManager<IdentityUser>(userStore); var user = new IdentityUser() { UserName = UserName.Text }; IdentityResult result = manager.Create(user, Password.Text); if (result.Succeeded) { var authenticationManager = HttpContext.Current.GetOwinContext().Authentica ...

Go to the complete details ...