i m trying to create a user and add a role to the user and also add its personalization like first name and last name, all at the same time but there is a problem with the personalization .
Since on the point i create the user its anonymous but is there a way to get the user from the database so that when i add the personalization it is not anonymous.
This is my codes in VB
Public Sub CreateUser_OnCl ick(ByVal sender As Object, ByVal args As EventArgs) Handles CreateUserButto n.Click
Dim result As MembershipCreat eStatus
Try
' Create new user.
Dim newUser As MembershipUser
newUser = Membership.Crea teUser( _
UsernameTextbox .Text, _
PasswordTextbox .Text, _
EmailTextbox.Te xt)
Roles.AddUserTo Role(UsernameTe xtbox.Text, DropDownList1.S electedValue)
Profile.FirstNa me = TextBox1.Text
Profile.LastNam e = TextBox2.Text
Profile.Approve Limit = TextBox3.Text
Profile.Status = TextBox4.Text
Response.Redire ct("login.aspx" )
Catch e As MembershipCreat eUserException
Msg.Text = GetErrorMessage (e.StatusCode)
Catch e As HttpException
Msg.Text = e.Message
End Try
End Sub
Since on the point i create the user its anonymous but is there a way to get the user from the database so that when i add the personalization it is not anonymous.
This is my codes in VB
Public Sub CreateUser_OnCl ick(ByVal sender As Object, ByVal args As EventArgs) Handles CreateUserButto n.Click
Dim result As MembershipCreat eStatus
Try
' Create new user.
Dim newUser As MembershipUser
newUser = Membership.Crea teUser( _
UsernameTextbox .Text, _
PasswordTextbox .Text, _
EmailTextbox.Te xt)
Roles.AddUserTo Role(UsernameTe xtbox.Text, DropDownList1.S electedValue)
Profile.FirstNa me = TextBox1.Text
Profile.LastNam e = TextBox2.Text
Profile.Approve Limit = TextBox3.Text
Profile.Status = TextBox4.Text
Response.Redire ct("login.aspx" )
Catch e As MembershipCreat eUserException
Msg.Text = GetErrorMessage (e.StatusCode)
Catch e As HttpException
Msg.Text = e.Message
End Try
End Sub