ERIK - the code you gave me doesnt seem to do it -
This is so frustrating - reading over the membership doc doent really give more than a high level overview
(DNN 4.4.0)
How do I create a profile for a user i create like this
If Page.IsValid Then
Dim myUserInfo As Users.UserInfo = New Users.UserInfo
With myUserInfo
'Membership
.Membership.Username = Me.tbUserName.Text
.Membership.Email = Me.tbEmailAddress.Text
.Membership.Approved = True
.Membership.Password = Me.tbPassword.Text
'Profile
.Profile.FirstName = Me.tbFirstName.Text
.Profile.LastName = Me.tbLastName.Text
.Profile.Unit = Null.NullString
.Profile.Street = Null.NullString
.Profile.City = Null.NullString
.Profile.Region = Null.NullString
.Profile.PostalCode = Null.NullString
.Profile.Country = Null.NullString
.Profile.Telephone = Null.NullString
'DNN
.PortalID = PortalId
.Username = Me.tbUserName.Text
.FirstName = Me.tbFirstName.Text
.LastName = Me.tbLastName.Text
.Email = Me.tbEmailAddress.Text
.AffiliateID = Null.NullInteger
.DisplayName = Me.tbFirstName.Text.Trim & " " & Me.tbLastName.Text.Trim
End With
Dim CreateStatus As UserCreateStatus = Users.UserController.CreateUser(myUserInfo)
myUserInfo.Profile.InitialiseProfile(PortalId)
Dim something_other As New Entities.Profile.ProfilePropertyDefinitionCollection
something_other = Entities.Profile.ProfileController.GetPropertyDefinitionsByPortal(PortalId)
Dim num As Integer = 0
For Each x As Entities.Profile.ProfilePropertyDefinition In something_other
Response.Write(x.PropertyName)
Response.Write("--")
Response.Write(x.PropertyValue)
Response.Write("<br />")
Next
Users.UserController.UpdateUser(PortalId, myUserInfo)
'Here we check the user status of the user we created or tried to create
'if there is a problem we pull up a message and keep the page up so they
'can change it - possibility of marking the field wrong exists maybe
'Response.Write(myUserInfo.UserID)
End If
Nothing is ever created in the UserProfile table untill I go check and update the profile through the DNN interface - I cant figure out how the default register page does this