Posts

Showing posts with the label SPListItem

How to add ListItem to List, "Person or Group" column

        SPWeb website = SPControl.GetContextWeb(Context);         SPList oList = website.GetList("/Lists/Team%20Members");                 SPListItem item = oList.Items.Add();         SPUser user;         website.AllowUnsafeUpdates = true;          user = website.SiteUsers["MOSSDEV1\\abc"];         item["Member"] = user;         item.Update();         website.AllowUnsafeUpdates = false;