Thursday, October 6, 2011

People Picker Control in VS2010 to get the SharePoint Users Email

Using People Picker Control in VS2010 to get the SharePoint Users Email, First Name,.......etc.

Use the following tag in your Visual Web part user control
<SharePoint:PeopleEditor ID="myPeoplePicker" runat="server" SelectionSet="User" />
To access the user email id entered in the control, use the following code
PickerEntity pckEntity = (PickerEntity)myPeoplePicker.ResolvedEntities[i];
string email = pckEntity.EntityData["Email"].ToString();
 
http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/
 Thanks to Karine Bosch! 
 
Happy SharePointing!!!.

No comments:

Post a Comment