I am using personalization/profile to store info for the user that is not
contained in the aspnet_Users or aspnet_Membership tables. This info
includes, firstname, lastname, and phonenumber.
On my "signup" page I ask for all their info at one time, including
username, password, firstname, lastname, etc.... After I do a
Membership.CreateUser and Roles.AddUserToRole I want to store the profile
information. But, the code still thinks I'm 'Anynomous' when I get to the
profile part.
Here's a portion of the web.config....
<profile>
<properties>
<group name="PersonalInfo">
<add name="FirstName" />
<add name="LastName" />
<add name="PhoneNumber" />
</group >
</properties>
</profile>
Here's a portion of my code for the "Create User"...
Dim newUser As MembershipUser =
System.Web.Security.Membership.CreateUser(Me.txtUs ername.Text,
Me.txtPassword.Text, _
Me.txtEmail.Text,
Me.txtSecurityAnswer.Text, _
Me.txtSecurityAnswer.Text,
False, status)
If newUser Is Nothing Then
Me.lblUserReject.Text = GetErrorMessage(status)
Exit Sub
Else
' put new user in member role
System.Web.Security.Roles.AddUserToRole(newUser.Us erName.ToString,
"Member")
' user personalization
With Profile.PersonalInfo
.FirstName = Me.txtFirstName.Text
.LastName = Me.txtLastName.Text
.PhoneNumber = Me.txtMyPhone.Text
End With
Am I doing this correctly? Do I have the right idea? Any suggestions or
ideas?
Thanks.