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 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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
  #11 (permalink)  
Old February 7th, 2014, 12:43 PM
Friend of Wrox
Points: 595, Level: 8
Points: 595, Level: 8 Points: 595, Level: 8 Points: 595, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Hi Imar,

Thank you for the helpful options.

I guess I'm still a little confused as to what custom code is refering to? After a successful signup registration, it looks like the CreateWizard controls default behavior is to display a "Complete Your account has been successfully created." message followed by the "Continue" button. Are you referring to this logic as custom code?

After a successful signup registration, user is still sent to the SignUp.aspx page (after the postback). What happens to the UserNameRequired control?

Thanks,
Tulsi
Reply With Quote
  #12 (permalink)  
Old February 9th, 2014, 08:14 AM
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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

With custom code, I was referring to the code you added to check the user name with a web method. That code also fires after the account has been created successfully which will result in an error because the error message is no longer present.

My work arounds from my previous post should resolve the issue.

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
  #13 (permalink)  
Old March 18th, 2014, 01:48 PM
Friend of Wrox
Points: 595, Level: 8
Points: 595, Level: 8 Points: 595, Level: 8 Points: 595, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Hi Imar,

I was trying to implement option #1 (1. Redirect the user to a "thank you for registering" page that doesn't have this code.), but am not having much luck.

I added a Response.redirect to another page as follows:

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
Response.Redirect("~/TestPage.aspx");
}

When trying to signup for a new account, I do get redirected to TestPage.aspx, but for some reason do not get logged into the site.

Is there a step that I am missing?

Thank you.

Tulsi
Reply With Quote
  #14 (permalink)  
Old March 18th, 2014, 02:58 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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

According to this page: http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx the user is logged in *after* CreatedUser has fired. So if you redirect away in that event, the user is never logged in.

There are a few solutions to this:

1. Set the ContinueDestinationUrl or FinishDestinationUrl so the user gets redirected when she clicks the appropriate button (can't recall which one you need). For more info: http://msdn.microsoft.com/en-us/libr...roperties.aspx

2. Inside CreatedUser set a flag that the user has been created. Then inside OnPreRender (which fires late, after the user has been logged in) redirect when the flag is true.

Hope this helps,

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
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (March 20th, 2014)
  #15 (permalink)  
Old March 20th, 2014, 02:27 PM
Friend of Wrox
Points: 595, Level: 8
Points: 595, Level: 8 Points: 595, Level: 8 Points: 595, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Thank you so much! I implemented solution #2 and it works great!

Tulsi
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
ASP.NET Membership and ActiveDirectory Quick209 ASP.NET 2.0 Professional 0 June 13th, 2007 12:41 PM
Help with ASP.NET Membership VerbatimBOT SQL Server 2000 6 May 2nd, 2007 01:58 PM
Roles and membership asp.net 2 zeeshannasir ASP.NET 1.x and 2.0 Application Design 1 September 22nd, 2006 03:34 AM
Roles and membership asp.net 2 zeeshannasir ASP.NET 2.0 Basics 2 September 15th, 2006 07:24 AM
Checking for controls existence .NET 2.0 sarosh General .NET 0 March 1st, 2006 02:30 AM



All times are GMT -4. The time now is 04:17 PM.


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