| 

.NET C# Java Javascript Exception

1
Wie kann man in Sharepoint ein PeopleEditor (People Picker) - Control mit Current User vorbelegen [programmatisch in Visual Studio 2010]?
09.05.2011
Celophysis 87 1 5
2 Antworten
0
Vorbelegen
peoplePick1.CommaSeparatedAccounts = SPContext.Current.Web.CurrentUser.Name;

PeopleEditor ist Teil von Microsoft.SharePoint.WebControls.
SPContext => Microsoft.Sharepoint namespace

Speichern
SPListItem item = listItems.Add();
... + übrige notwendige listitem-FeldZuweisungen
string[] UsersSeperated = peoplePick1.CommaSeparatedAccounts.Split(',');
SPFieldUserValueCollection UserCollection = new SPFieldUserValueCollection();
foreach (string UserSeperated in UsersSeperated)
{
myweb.EnsureUser(UserSeperated);
SPUser User = mySite.SiteUsers[UserSeperated];
SPFieldUserValue UserName = new SPFieldUserValue(myweb, User.ID, User.LoginName);
UserCollection.Add(UserName);
}
item["Mitarbeiter"] = UserCollection;
item.Update();
09.05.2011
Celophysis 87 1 5
0
17.05.2011
Celophysis 87 1 5

Stelle deine .net-Frage jetzt!
TOP TECHNOLOGIES CONSULTING GmbH