Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserProfileManager problem

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL
I have a web part (in c#) that contain TextBox, Button and Datagrid. I want that when the user enter name into the textBox and click on button , it will give him all the users in the DataGrid (can be more then one).

For this I use in me code the UserProfileManager object and I run in a While loop on all user in the user profiles list (and search FirstName or LastName that contain the value i the TextBox) - by a IEnumerator..... But I get an error massage that only manager in the site or user with permmision for change user profile can accses to this UserProfiles IEnumerator!!!!!

How can I do this search that each user will be able to access the UserProfile list.

I use this code:

UserProfileManager objManager = new UserProfileManager(portalContext);
UserProfile userProfile ;

IEnumerator allProfiles= objManager.GetEnumerator();

while (allProfiles.MoveNext())
{
firstName=null;
lastName=null;
userProfile = (UserProfile)allProfiles.Current;
.
.
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top