Results 1 to 2 of 2

Thread: [RESOLVED] createuserwizard error

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Resolved [RESOLVED] createuserwizard error

    Hi there I have a createuserwizard that I wish to store the userid in an additional table as well as the default aspnet_user table

    i am using vb, the code is as follows

    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser

    Dim objTextBox1 As TextBox
    objTextBox =

    objTextBox1 = CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName")

    Dim user As MembershipUser = Membership.GetUser(objTextBox1.Text)
    Dim UserGUID As Object = user.ProviderUserKey

    ' some code to update database ----

    End Sub

    this should return the new users UseID and there are tons of tutorials anf forums saying it does but when I use it I get a

    InvalidCastException - specified cast is not Valid which points to

    Dim user As MembershipUser = Membership.GetUser(objTextBox1.Text)

    anyone have anyideas as i am told this should work

    lee

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Exclamation

    fixed the problem dont have the answer what it was but deleted the database and recreated and it works, microsoft say it happens if you edit the aspnet tables directly without using tools like asp.net configurator
    it works now anyway
    thanks all lee

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