How can I convert this:
RoleManager roleManager = new RoleManager(new RoleStore(new IdentityDbContext()));
UserManager userManager = new UserManager(new UserStore(new ApplicationDbContext()));
roleManager.Create(new IdentityRole(RoleName));
ApplicationUser user = userManager.FindByEmail(UserName);
userManager.AddToRole(user.Id, RoleName);
to two dropdown lists and one button?
I want add role to user in default database. Thx
asp.net

Amit ChoudharyRank #145 · 15.8K reputationPosted Nov 4, 2015, 9:04 AM EST
Mikulas Luckanic5 reputationPosted Nov 4, 2015, 9:34 AM EST
Amit ChoudharyRank #145 · 15.8K reputationPosted Nov 4, 2015, 10:16 AM EST
Mikulas Luckanic5 reputationPosted Nov 4, 2015, 10:19 AM EST
Ravi PatelRank #439 · 5.7K reputationPosted Nov 4, 2015, 8:00 PM EST
@Html.DropDownList("selectedRoleId", (SelectList)ViewBag.RoleName)
in Controller
[HttpPost]
public ActionResult Action(string selectedRoleId)
{
// if you want role name then you can fetch from database with the help of selectedRoleId
return View();
}