Get list of users assigned to a specific role

I have a role called Contractor...  In code, I need to get the list of all users assigned to this role for display in a Drop Down List...  Can someone provide me a sample set of code for doing this using DNN objects...  Thanks...
0
cudget
9/30/2005 12:59:36 AM
asp.net.dotnetnuke 25171 articles. 0 followers. Follow

1 Replies
740 Views

Similar Articles

[PageSpeed] 55


 This should get you started. You can then bind to a ddl or an array. Just replace the RoleId with that of the Contractor roleid.

Dim objUser As new UserController

objUser.GetRoleMembership(PortalId, RoleId, UserId)

0
ech01
9/30/2005 7:26:59 PM
Reply:

Similar Artilces:

Problem : Get a list of user belonged to a role or to know if a user already has a role
What code can I write to know if a user belonged to a Role already ? and How can I get a list of a  user already in an existing role ? Please have a look at my code below : Protected Sub AddUsers_OnClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddUsersToRole.Click' I wanna add some code here to check if a user already belonged to a Role' Please insert your code here. Thanks a lot. ' A role must be selected If RolesListBox.SelectedItem Is Nothing Then Msg.Text = "Please select a role." Exit Sub End If ...

Getting all Users from Membership by a specific Role
hi all, i am looking for a way to get all users that belong to a specific role in my membership system but am stuck. I have googled everywhere but cant seem to find any examples of getting a users role.  Can anyone provide me any examples.  basically i have two roles ADMIN and SALES.  I want to get a collection of all users in SALES so i can shoot them a mass email. thanks, mcm string[] users = Roles.GetUsersInRole(rolename);foreach (string user in users) { //Response.Write(user.ToString()); //do your emailing here }/GuruBhai SELECT aspnet_Membership.Email ...

Returning a list of users with a specific role.
Hello, I am new to .net development and am building a website using the new .net 2.0 management features. I have users and roles setup on my website and was wondering if there is a function I can use to return all the users in a certain role or do I have to query the database directly with a rather complicated sql statement. Basically, what I want is a list control that displays all the users in a certain role. A point in the right direction would be greatly appreciated.   Trent Hi Trent, Here is a good page with some security resources that I'd recommend checking out: http://w...

Getting list of all users in Superuser role
Hello, I need a way to return a list of all the UserID's for the Superuser role. I tried using GetUsersInRole but it looks like this function is only for "regular" roles. For example : Public Function GetUserIDsInSuperuserRole(ByRef PortalID As Integer) As ArrayList     Dim arrUsers As New ArrayList     Dim objRoles As New DotNetNuke.Security.Roles.RoleController     For Each objUser As DotNetNuke.Entities.Users.UserRoleInfo In objRoles.GetUsersInRole(PortalID, glbRoleSuperUser)         arrUsers.Add(objUse...

Login controls
HiI'm building a web app in visual studio 2005 and I'm setting up a 'create user' page for the admin part of the app. I'm creating a customised CreateUserWizard so that I can add a user to the asp.net membership list (in database on my server) and also add some info to one of my tables (user first name, faculty they work for etc).  I want to be able to let the admin user allocate roles (those already defined in my config) from a drop down list. I want to inculde this in my create user wizard, and have an 'update user' section where I can change their role the...

VB.Net Help : Assign user to role at registration
Hi im a real newbie and need alittle help with this problem any help would be greatly appriacted, im trying to let the user select there account type during registration so i can structure content dependent on the role, the problem i now have is that i have 4 roles, Administrator, Customer, Landscaper, Wholesales, i found a tutorial that allows me to let the user select there role and its works fine, my problem is that i dont want them to be able to select the admin role, infact i dont want it to appear in the checklist box at all, can someone take a look please, code is attached, thanks in...

Assign Specific Data to Specific Users
I am very early on in developing a website to track issues with projects which is tied to a SQL database.  I have my Projects Table, my Users Table, and am creating a third table to track issues.  I'm wondering what is the best way to assign specific users to specific data/projects.  The user should only be able to view & update the projects assigned to him.  He should not be able to see other projects.  What is the best way to assign projects/data to the users to make sure they are only viewing their data? I guess you can projectid...

how can i write this line using vb.net: List<User> myList = new List<User>();
and which package i need to import System.Collections.GenericDim myList as new List(Of User) If this post is useful to you, please mark it as answer. avi999912: and which package i need to import Hi, If searching in MSDN, you will get this page: http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx, in which, you can find the package at the Namespace subject. .NET Framework Class Library List(T) Class Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists. Namespace:  System.Collections...

Getting a list of USERS from an NT USER GROUP
Dear Beginners, I have a small task of getting NT user list from a NT USER GROUP. Please suggest me.. Thanking you.... With Regards Rajuveera coincidently, i had to do the same thing yesterday... i used Win32::AdminMisc module, which you can obtain from www.roth.net the docu is good, so it should all explain itself from there. if your'e still stuck after installing, msg me, i'll send you some sample code. regards, Jos ----- Original Message ----- From: "Veeraraju_Mareddi" <rajuveera@satyam.com> To: <beginners@perl.org> Cc: <perl...

stored procedure to get all users or all users of a specific country
hi alli've got two tables called "webusers" (id, name, fk_country) and "countries" (id, name) at the meantime, i've a search-page where i can fill a form to search users. in the dropdown to select the country i included an option which is called "all countries". now the problem is: how can i make a stored procedure that makes a restriction to the fk_country depending on the submitted fk_country parameter?it should be something like SELECT * FROM webusers(if @fk_country > 0, which is the value for "all countries"){    WHERE ...

How Get proxy users lists for Every GW Users ??
How i can get 1. Proxy users list for every GW users ? 2. Proxy users lists Right for every GW users ? GW7Sp1. Serg Doesn't TID 10050654 still work ? Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ > Doesn't TID 10050654 still work ? > > Cheers Dave Thank you, Dave. Will be read and test this. Serg It should still work Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ Try this.... Demo version can report it... http://eng.itq.dk/default.a...

Removing user from list of users list
Hi,=20 I have the following situation: A user who has been creating, testing, commenting bugs does not work here any more, I have already to delete but this will result in an inconsistency in the database or the bugs he has been involved in will not be displayed.=20 I just want that from now on his user does not appear among the list (assigned or CC).=20 Is there any way to do so? Thanks Cinthya cinthya.kamberi@nokia.com escribi�: > I have the following situation: > > A user who has been creating, testing, commenting bugs does not work > here any more, I ...

can`t get role list from role sub-container
In Designer UserApplication->Role Catalog->Roles->ITRole I create several "Role Sub-Container". There are several roles in each sub-container. What I want to do is to get "roleSubContainer1" role list in User Application request form dynamically. I log in as userApplicationAdmin with full rights on all tree. The problem is I can't get role list. I cant select "roleSubContainer1" container via DNLookup, it`s not visible. IDVault.containers() seems good, but if returns containers only. Role item is not a container. IDVault.globalQuer...

Specific User -> Administrator Roles & Authorized Roles
Hi All, Has there been any discussion about setting up Administrator and Authorized Roles for, Tabs and Modules to based on a specific user? I think it would be handy to have a specific user control a specific module or tab. For example, let say I want UserABC to have edit control of the links module without creating a special role for that user. I would also see this being important if there is ever a file manager for specific users. For files they only have access to. -- Ingram ...

Web resources about - Get list of users assigned to a specific role - asp.net.dotnetnuke

Internet Assigned Numbers Authority - Wikipedia, the free encyclopedia
The Internet Assigned Numbers Authority ( IANA ) is the entity that oversees global IP address allocation, autonomous system number allocation, ...

Coalition ministers assigned bodyguards
Four senior ministers in the Abbott government have been assigned secret-service style protection amid an angry backlash over the federal budget, ...

Security concerns: 3500 more troops assigned to Olympics
Security concerns: 3500 more troops assigned to Olympics

Coalition ministers assigned bodyguards
Four senior ministers in the Abbott government have been assigned secret-service style protection amid an angry backlash over the federal budget, ...

Thai crown prince Maha Vajiralongkorn revokes wife's royally-assigned family name
Thailand's crown prince revokes the royally-assigned family name of his wife, amid cases of corruption.

New area code assigned to Quebec
The Canadian Radio-television and Telecommunications Commission (CRTC) said Wednesday that it will introduce a new area code for the 819 region ...

New Hampshire man arrested after protesting Jodi Picoult book assigned to teen daughter - CTV News
A New Hampshire dad was arrested at a school board meeting after protesting a book assigned to his teen daughter that contained what he said ...

One tln debt swap quota assigned to regional gov't
One tln debt swap quota assigned to regional gov't

Apple’s next-generation Apple TV moves closer to reality, assigned J33 codename
iOS release history tells us that as a product in development moves even closer to release, it is assigned a proper codename. Not only an identifier ...

Zimbabwe: ZBC Managers Re-Assigned
allAfrica: African news and information for a global audience The Zimbabwe Broadcasting Corporation has re-assigned senior managers as part of ...

Resources last updated: 11/29/2015 8:19:59 PM