2

I have the following problem. I want to add custom fields to my registration data in ASP. I've done this on the following way.

 Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As       System.EventArgs) Handles CreateUserWizard1.CreatedUser
    ' create an empty profile
    Dim p As ProfileCommon = ProfileCommon.Create(CreateUserWizard1.UserName, True)



    ' fill profile with values from CreateUserStep
    p.LastName = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName"), TextBox).Text

    p.Name = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtName"), TextBox).Text

    p.BirthDate = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtBirthDate"), TextBox).Text

    p.PostCode = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtPostCode"), TextBox).Text

    p.RegNr = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtRegNr"), TextBox).Text


    MsgBox(p.LastName)
    MsgBox(p.Name)
    MsgBox(p.BirthDate)
    MsgBox(p.PostCode)
    MsgBox(p.RegNr)

    ' save profile
    p.Save()
End Sub

I've also created the right properties in de web.config file. When I catch the data in the msgboxes, it shows the right data.

But my tables in the database doesn't fill. Only the default UserName, Password etc. fill. I've created new fields in my aspnet_profile table. But nothing happens.

Does anybody know what's the reason of this problem? Why my profile information doesn't store in the DB.

Thanks in advance!

Kind regards

0 Answers0