I'm adding and manipulating the memberhship class programatically... not a huge deal... except this freaking IsApproved property doesn't want to work. I have no idea why. Everything is working fine, because it's all getting created with the right information, and I can log in as the new user... but if I don't select Active, I shouldn't be able to... and yet I still can... Here's what I've got running right now. Any brilliant ideas?
vb Code:
Dim txtCB As TextBox = dvUsers.FindControl("txtCreatedBy") txtCB.Text = Membership.GetUser.UserName.ToString Dim cbChecked As CheckBox = dvUsers.FindControl("cbActive") Dim txtUser As TextBox = dvUsers.FindControl("txtUser") Dim txtPassword As TextBox = dvUsers.FindControl("txtPassword") Dim txtEmail As TextBox = dvUsers.FindControl("txtEmail") Dim usr As MembershipUser usr = Membership.CreateUser(txtUser.Text, txtPassword.Text, txtEmail.Text) dvUsers.Fields(14).Visible = True Dim txtUID As TextBox = dvUsers.FindControl("txtUID") txtUID.Text = usr.ProviderUserKey.ToString If cbChecked.Checked Then usr.IsApproved = True Else usr.IsApproved = False End If Roles.AddUserToRole(txtUser.Text, "Sales Person") dvUsers.InsertItem(False) dvUsers.ChangeMode(DetailsViewMode.ReadOnly) lblStatus.Text = "User added successfully!" btnCancel.Text = " Done " btnUpdate.Visible = False lblStatus.Visible = True




Reply With Quote