View user's post blocked in membership

1

I need to display a message when the blocked user tries to sign in membership ... I set the user locked with the IsApproved property = false; at time of registration

MembershipUser lockUser = Membership.GetUser(txtEmail.Text);
lockUser.IsApproved = false;
Membership.UpdateUser(lockUser);

Is there any way?

    
asked by anonymous 20.05.2014 / 18:15

1 answer

3

On your login button:

protected void Button1_Click(object sender, EventArgs e)
{
    MembershipUser user = Membership.GetUser("Yourusername");

    if(user != null && !user.isApproved) {
        ClientScript.RegisterStartupScript(
           this.GetType(), "myalert", "alert('O usuário não está aprovado.');", true);
    }
}
    
20.05.2014 / 18:32