Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CreateUserWizard Notes.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CreateUserWizard Notes.

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: CreateUserWizard Notes.
    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.
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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?
 
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2005 at 2:02pm
Yes, I am using VWD. I think it is specifically related to that.
David.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.