Results 1 to 2 of 2

Thread: [RESOLVED] [2005] Membership class issues

  1. #1

    Thread Starter
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Resolved [RESOLVED] [2005] Membership class issues

    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:
    1. Dim txtCB As TextBox = dvUsers.FindControl("txtCreatedBy")
    2.             txtCB.Text = Membership.GetUser.UserName.ToString
    3.  
    4.             Dim cbChecked As CheckBox = dvUsers.FindControl("cbActive")
    5.  
    6.             Dim txtUser As TextBox = dvUsers.FindControl("txtUser")
    7.             Dim txtPassword As TextBox = dvUsers.FindControl("txtPassword")
    8.             Dim txtEmail As TextBox = dvUsers.FindControl("txtEmail")
    9.             Dim usr As MembershipUser
    10.             usr = Membership.CreateUser(txtUser.Text, txtPassword.Text, txtEmail.Text)
    11.  
    12.             dvUsers.Fields(14).Visible = True
    13.  
    14.             Dim txtUID As TextBox = dvUsers.FindControl("txtUID")
    15.  
    16.             txtUID.Text = usr.ProviderUserKey.ToString
    17.  
    18.             If cbChecked.Checked Then
    19.                 usr.IsApproved = True
    20.             Else
    21.                 usr.IsApproved = False
    22.             End If
    23.  
    24.             Roles.AddUserToRole(txtUser.Text, "Sales Person")
    25.  
    26.             dvUsers.InsertItem(False)
    27.             dvUsers.ChangeMode(DetailsViewMode.ReadOnly)
    28.             lblStatus.Text = "User added successfully!"
    29.             btnCancel.Text = " Done "
    30.             btnUpdate.Visible = False
    31.             lblStatus.Visible = True

  2. #2

    Thread Starter
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2005] Membership class issues

    Why can't I delete threads when I need to? Damn that was a dumb question...

    Membership.UpdateUser(usr)

    Boom. Instant work. Yay.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width