Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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
  #1 (permalink)  
Old October 16th, 2006, 10:20 AM
Authorized User
 
Join Date: May 2005
Location: Manchester, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Roles

Chapter 9

Hi,

Is it possible that when creating or editing a user, to force them to be inserted into a certain role that I have set up for general users?

Thanks



  #2 (permalink)  
Old October 16th, 2006, 03:28 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi jackandjo,

Yes, that's possible and it's pretty easy to do.

You can assign a user to a role with the follow code (in the CreatedUser event for example)

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object,
     ByVal e As System.EventArgs)
     Handles CreateUserWizard1.CreatedUser
Roles.AddUserToRole(CreateUserWizard1.UserName , "Your Role Name")
End Sub

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old October 17th, 2006, 03:12 AM
Authorized User
 
Join Date: May 2005
Location: Manchester, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers



Similar Threads
Thread Thread Starter Forum Replies Last Post
Roles bhasker_braj121 SQL Server 2005 1 January 19th, 2008 12:10 PM
roles and management MunishBhatia ASP.NET 2.0 Professional 2 November 3rd, 2007 01:01 AM
RoleGroups and Roles durban ASP.NET 2.0 Basics 3 September 19th, 2007 01:24 PM
Sitemapnode and roles luca ASP.NET 2.0 Basics 0 September 12th, 2007 11:30 AM
Roles Permissions Many to Many ... Why? seanmayhew BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 5th, 2004 10:51 AM





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