SPFieldUserValueCollection pmCollection = new SPFieldUserValueCollection();
for...{
SPUser user= SPContext.Current.Site.RootWeb.AllUsers[your username];
SPFieldUserValue UserName = new SPFieldUserValue(web, user.ID, user.ID.ToString());
pmCollection.Add(UserName);
}
SPContext.Current.ListItem[your field name] = pmCollection;
// save item
SaveButton.SaveItem(SPContext.Current, false, string.Empty);
SPContext.Current.ListItem.Update();
沒有留言:
張貼留言