p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   CreateUserWizard - UserCreated Event (http://p2p.wrox.com/showthread.php?t=98519)

Grodnik January 30th, 2016 04:54 PM

CreateUserWizard - UserCreated Event
The background: I need to get the UserName to create an application table with UserName as a column.
I have created a wizard step to get 2 application text fields. When I click the Finish button on that step, I execute a wzCreateUser_FinishButtonClick subroutine. The first line is

Dim TheUser As String = User.Identity.Name
, and TheUser is available and I can then proceed to create the application table.
My Question: There is a CreatedUser event that nominally 'occurs after the membership provider has created a new Web Site user account'. However, when I code

Dim TheUser As String = User.Identity.Name

Protected Sub wzCreateUser_CreatedUser(sender As Object, e As EventArgs) Handles wzCreateUser.CreatedUser
, TheUser is empty. Why? If the username has been created, where do I find it? I am finding this wizard to be a bit mysterious.
Thank you.

Imar January 30th, 2016 05:01 PM

Hi there,

The user is created in that step, but not logged in yet. Redirect to a next page and try to access the name there.



All times are GMT -4. The time now is 06:50 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.