Hi,
I put a CreateUserWizard controll in my page to create users. One
thing I notice is that after a user is created and when I goes to
other pages, the property: Page.User.Identity.Name is changed to the
newly created user.
I guess it is that the CreateUserWizard automatically log the new user
in? My question is that is there a switch or setting to stop this?
My site allow admin user to create users and I don't want newly
created users got logon automatically.
Cheers,
Jerry
Riki - 19 Nov 2007 11:58 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> My site allow admin user to create users and I don't want newly
> created users got logon automatically.
Don't use the wizard, but use something like the following code to create a
new user (VB.NET):
Try
Dim status As MembershipCreateStatus = Nothing
Dim user As MembershipUser =
Membership.CreateUser(tbUserName.Text, tbPassword.Text, _
tbEmail.Text, strPhrase, strAnswer, True, status)
If (status = MembershipCreateStatus.Success) Then
Roles.AddUserToRole(tbUserName.Text, tbRole.Text)
lblInfo.Text = "The user was successfully added."
Else
lblError.Text = status.ToString()
End If
Catch ex As Exception
lblError.Text = ex.Message
End Try

Signature
Riki
frank - 21 Dec 2007 03:03 GMT
Set the property - LoginCreatedUser to False.
> Hi,
>
[quoted text clipped - 11 lines]
>
> Jerry