Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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
 
Old February 7th, 2014, 12:43 PM
Friend of Wrox
 
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
 
Old February 9th, 2014, 08:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old March 18th, 2014, 01:48 PM
Friend of Wrox
 
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
 
Old March 18th, 2014, 02:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (March 20th, 2014)
 
Old March 20th, 2014, 02:27 PM
Friend of Wrox
 
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.