in aspx page:
<SharePoint:PeopleEditor ID="id1" Width="350px" runat="server" PlaceButtonsUnderEntityEditor="false"
AllowTypeIn="True" MultiSelect="true" EnableBrowse="True" AllowEmpty="false" />
in code behind:
SPFieldUserValueCollection id1UserCollection = new SPFieldUserValueCollection();
string[] id1UsersSeperated = id1.CommaSeparatedAccounts.Split(',');
foreach (string UserSeperated in peStaffInvolvedUsersSeperated)
{
SPUser User = oWeb.EnsureUser(UserSeperated);
SPFieldUserValue UserName = new SPFieldUserValue(oWeb, User.ID, User.LoginName);
id1UserCollection.Add(UserName);
CheckUserifExist(User);
}
itemToAdd["people and group"]=idUserCollection;
<SharePoint:PeopleEditor ID="id1" Width="350px" runat="server" PlaceButtonsUnderEntityEditor="false"
AllowTypeIn="True" MultiSelect="true" EnableBrowse="True" AllowEmpty="false" />
in code behind:
SPFieldUserValueCollection id1UserCollection = new SPFieldUserValueCollection();
string[] id1UsersSeperated = id1.CommaSeparatedAccounts.Split(',');
foreach (string UserSeperated in peStaffInvolvedUsersSeperated)
{
SPUser User = oWeb.EnsureUser(UserSeperated);
SPFieldUserValue UserName = new SPFieldUserValue(oWeb, User.ID, User.LoginName);
id1UserCollection.Add(UserName);
CheckUserifExist(User);
}
itemToAdd["people and group"]=idUserCollection;