Click on this icon to open the XML page.Tom Van Gaever - Blog
Search:   

Using SharePoint PeopleEditor Control 
Friday, August 8, 2008, 15:29 - SharePoint
Posted by Administrator
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
</tom>

add comment ( 16 views )   |  permalink   |  related link   |   ( 2.6 / 488 )

<<First <Back | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Next> Last>>