Print Page | Close Window

CreateUserWizard Notes.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=15261
Printed Date: 29 March 2026 at 5:16am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: CreateUserWizard Notes.
Posted By: davidshq
Subject: CreateUserWizard Notes.
Date Posted: 27 May 2005 at 4:14pm
The new CreateUserWizard ability in Visual Web Developer Express is excellent, however as I was working with it I ran into two big problems. I've figured them both out and figured I'd record them here in case any of you have the same:
1. When you use the CreateUserWizard it doesn't give you the ability to give the user a role automatically. But if you click on the CreateUserWizard it will bring up the prompt
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
   To set the current user a role just type:
Roles.AddUserToRole(CreateUserWizard1.UserName, "NameofRole")
2. When one adds a role as above it for some reason (seems like a bug) deactivates the user and you must reactivate the user before they can login. This can be done as follows:
Dim nuser as String
nuser=CreateUserWizard1.UserName
Dim cuser as MembershipUser = Membership.GetUser(nuser)
cuser.IsApproved=True
Membership.UpdateUser(cuser)

I should give credit where credit is due. I learned (1) from someplace I've forgotten and (2) from http://www.awprofessional.com/articles/article.asp?p=351414&seqNum=1&rl=1.
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.



Replies:
Posted By: michael
Date Posted: 28 May 2005 at 12:22pm
Originally posted by davidshq davidshq wrote:


2. When one adds a role as above it for some reason (seems like a bug) deactivates the user and you must reactivate the user before they can login. This can be done as follows:
Dim nuser as String
nuser=CreateUserWizard1.UserName
Dim cuser as MembershipUser = Membership.GetUser(nuser)
cuser.IsApproved=True
Membership.UpdateUser(cuser)
 
I don't have this problem with the Beta2 of VS. Are you using VWD as it may be related to it?
 


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: davidshq
Date Posted: 31 May 2005 at 2:02pm
Yes, I am using VWD. I think it is specifically related to that.
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net