Ejemplo n.º 1
0
 protected void SetPassword_Click(object sender, EventArgs e)
 {
     if (IsValid)
     {
         // Create the local login info and link the local account to the user
         ILoginManager manager = new IdentityManager(new IdentityStore(new LibraryDbContext())).Logins;
         IdentityResult result = manager.AddLocalLogin(User.Identity.GetUserId(), User.Identity.GetUserName(), password.Text);
         if (result.Success) 
         {
             Response.Redirect("~/Account/Manage?m=SetPwdSuccess");
         }
         else 
         {
             AddErrors(result);
         }
     }
 }