protected void LoginButton_Click1(object sender, AuthenticateEventArgs e) { string password = this.Password.Text; string usuario = this.UserName.Text; GestionUsuario gestor = new GestionUsuario(); if (gestor.ValidateUser(usuario, password)) { MembershipUser usrInfo = Membership.GetUser(usuario); if (usrInfo != null) { // Email matches, the credentials are valid e.Authenticated = true; } else { // Email address is invalid... e.Authenticated = false; } } else { // Username/password are not valid... e.Authenticated = false; } }
protected void LoginButton_Click1(object sender, EventArgs e) { string password = this.Password.Text; string usuario = this.UserName.Text; GestionUsuario gestor = new GestionUsuario(); if (gestor.ValidateUser(usuario, password)) { FormsAuthentication.SetAuthCookie(usuario, true); Response.Redirect("Paginas/Default.aspx"); } }