Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 June 12th, 2011, 11:42 PM
Authorized User
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default question RE modifying the CreateUserWizard

I'm trying to modify ASP.NET membership on a site so that users must enter a pre-supplied registration code in order to activate their membership. I'm not sure what the best way is to go about doing this.
  • I'd like to be able to restrict new accounts from being activated until such a registration code is entered by the user.
  • I don't want to have to log in as an admin and approve/activate user accounts manually.
  • The “registration codes” would be supplied to users through an outside channel, and would be preloaded into the website's database.
  • Ideally, the codes would correspond to pre-set roles in the membership system, and a user would automatically be assigned the specific role their code entitled them to.
For example, there would be an “EnrollmentCode” table in the database with data as follows:
EnrollmentCodeID: 1
EnrollmentCode: eRuY673W
RoleGUID: 21ec2020-3aea-1069-a2dd-08002b30309d [ASP.NET GUID generated when a particular role was set up in the WSAT]
RoleName: customer1 [name corresponding to role set up in WSAT]
I have an idea of how this should function, but am not sure of the syntax I should be using; i.e.:

Option A:
  1. User is sent to CreateAccount.aspx page with an instance of the standard CreateUserWizard control.
  2. The DisableCreatedUser property is set to "true”, so the user's account is disabled upon creation, and the user is sent by the ContinueDestinationPageUrl property to an EnterEnrollmentCode.aspx page, where they are prompted to...
  3. Enter their pre-supplied enrollment code. If the code matches a row appearing in the database's EnrollmentCode table, the user's account is activated and the user is assigned the role corresponding to that code.
Option B:
  1. User creates an account in the CreateUserWizard, as above, but the wizard contains a custom step with a textbox for entering the enrollment code. Can a wizard step be used in this way to validate the code entered against the database, and to assign the role as specified by that database's row?
Thanks for any advice.
Old June 16th, 2011, 11:21 PM
Posts: n/a
Default Great Help!

Thanks for this.. its a great help for me as new.
Received Infraction

Similar Threads
Thread Thread Starter Forum Replies Last Post
CreateUserWizard Question SPDmma BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 April 11th, 2009 06:31 PM
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 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

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