Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2011, 11:42 PM
Authorized User
Points: 195, Level: 3
Points: 195, Level: 3 Points: 195, Level: 3 Points: 195, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: , , .
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default question RE modifying the CreateUserWizard

Hello,
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.
  #2 (permalink)  
Old June 16th, 2011, 11:21 PM
jhanica01
Guest
 
Posts: n/a
Default Great Help!

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


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 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



All times are GMT -4. The time now is 07:37 AM.


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