 |
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

February 7th, 2014, 12:43 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
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
|
|

February 9th, 2014, 08:14 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

March 18th, 2014, 01:48 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
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
|
|

March 18th, 2014, 02:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

March 20th, 2014, 02:27 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
Thank you so much! I implemented solution #2 and it works great!
Tulsi
|
|
 |
|