SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPListItemCollection
myColl = SPContext.Current.Web.Lists["Test People Editor"].Items;
SPListItem
item = myColl.Add();
SPUser
user = SPContext.Current.Web.EnsureUser(pplUserName.Accounts[0].ToString());
string
strUser = user.ID.ToString();
SPContext.Current.Web.Update();
item["UserName"] = strUser;
item.Update();
});
No comments:
Post a Comment