using(SPSite mainsite=new SPSite("SPContext.Current.Site.Url"))
{
using(SPWeb mainweb = site.OpenWeb())
{
//Custom List Name
SPList list = mainweb.Lists["MyList"];
// Add new listItem
SPListItem item = list .AddItem();
// UserID with domain
SPUser user = web.AllUsers["SharePoint\\Usama"];
item["Person"] = user;
item.Update();
}
}
:)
Update people field in List SharePoint 2010
Sunday, October 7, 2012
Posted by Usama Wahab Khan at 11:26 PM
Labels: SharePoint 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment