p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 16th, 2006, 11: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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 16th, 2006, 04:28 PM
Imar's Avatar
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 17th, 2006, 04:12 AM
Authorized User
 
Join Date: May 2005
Location: Manchester, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 02:01 AM
RoleGroups and Roles durban ASP.NET 2.0 Basics 3 September 19th, 2007 02:24 PM
Sitemapnode and roles luca ASP.NET 2.0 Basics 0 September 12th, 2007 12:30 PM
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 07:12 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc