Using SharePoint PeopleEditor Control

When you want to use the PeopleEditor control you need the correct refence in your custom SharePoint page.

<%
@Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Add a user to the picker (c#):

ArrayList list = new ArrayList();
list.Add(
    new PickerEntity()
    {
        Key = @"DOMAIN\User"
    }
);
userPicker.UpdateEntities(list);

Retrieve selected user(s)(c#):

PickerEntity pe = (PickerEntity)userPicker.Entities[0];
string username = pe.Key;
//or if the entities are resolved
PickerEntity pe = (PickerEntity)userPicker.ResolvedEntities[0];
string username = pe.Key;

that's it

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)