Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

CreateUserWizard changed page.User.Identity

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DAXU@hotmail.com - 17 Nov 2007 19:15 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.