【Sharepoint控件】MOSS列表添加时SPUser字段赋值

                           
 SPFieldUserValueCollection userColl = new SPFieldUserValueCollection();

                            ArrayList list = Manager.ResolvedEntities;

                            foreach (Microsoft.SharePoint.WebControls.PickerEntity p in list)

                            {

                                SPUser user = web.EnsureUser(p.Key);

                                SPFieldUserValue userValue = new SPFieldUserValue(web, user.ID, user.LoginName);

                                userColl.Add(userValue);

                            }

                            spi[ "Manager"] = userColl;

 

你可能感兴趣的:(SharePoint)