Programatically Binding Values to People Picker
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPSite site = SPContext.Current.Site;
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList list = web.Lists["SendDocument"];
SPListItem item = list.Items.Add();
//string testuser = PeopleTo.CommaSeparatedAccounts.ToString();
//SPUser newUser = SPContext.Current.Web.EnsureUser(PeopleTo.CommaSeparatedAccounts.ToString());
item["To"] = SPContext.Current.Web.EnsureUser(PeopleTo.CommaSeparatedAccounts.ToString());
item["tcc"] = txtBx.Text.ToString();
item.Update();
web.AllowUnsafeUpdates = false;
});
}
catch (Exception)
{
throw;
}
Comments
Post a Comment