Designer:
<SharePoint:PeopleEditor ID="peopelID" runat="server" Width="350px" SelectionSet="User"
MaximumEntities="1" MultiSelect="false" AllowEmpty="false" DoPostBackOnResolve="true"
ErrorMessage="Type and press the enter key." ValidatorEnabled="true" ForeColor="Blue" >
</SharePoint:PeopleEditor>
Code:
To check if the control contains value:
if (peopelID.ResolvedEntities.Count > 0)
{Do something...}
To clear the control:
peopelID.CommaSeparatedAccounts = null;
To read value:
PickerEntity picker = (PickerEntity)peopelID.ResolvedEntities[0];
Hashtable hstEntityData = picker.EntityData;
strWorkEmail = Convert.ToString(hstEntityData["Email"]);
CSS:
The control may look different based on the master page being used. So, you may need to use browser's developer tools to look for the style(s) to be changed.
No comments:
Post a Comment