Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 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 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: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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

 


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



All times are GMT -4. The time now is 04:45 AM.


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