Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 30th, 2016, 04:54 PM
Authorized User
Points: 91, Level: 1
Points: 91, Level: 1 Points: 91, Level: 1 Points: 91, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Location: rural Minnesota
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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
Code:
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
Code:
Dim TheUser As String = User.Identity.Name
in
Code:
 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.
Reply With Quote
  #2 (permalink)  
Old January 30th, 2016, 05:01 PM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CreateUserWizard AghaKhan ASP.NET 2.0 Professional 1 December 5th, 2007 08:14 PM
CreateUserWizard michaelcode ASP.NET 2.0 Basics 2 February 5th, 2007 06:17 PM
CreateUserWizard elavio ASP.NET 2.0 Basics 1 November 18th, 2006 07:50 PM
CreateUserWizard michaelcode ASP.NET 2.0 Basics 1 August 19th, 2006 09:04 AM
CreateUserWizard zoltac007 ASP.NET 2.0 Basics 4 June 1st, 2006 04:08 PM



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.