I have PeopleEditor:
<SharePoint:PeopleEditor ID="peopleEdit" ... SelectionSet="User,DL,SecGroup,SPGroup" />
It works flawlessly on the page, that is, I can select AD users, Sharepoint groups and everything that I would like.
The problem is that I cannot find the property in PeopleEditor which type of user / group will be returned . Take the following example:
//User: John Doe - mycompany\jondoe is at position 0 //Sharepoint group: "All Site Users" is at position 1 PickerEntity pickerEntity1 = (PickerEntity).peopleEdit.ResolvedEntities[1]; // pickerEntity1.Key = "All Site Users" // pickerEntity1.Claim = null // pickerEntity1.DisplayText = "All Site Users" PickerEntity pickerEntity0 = (PickerEntity).peopleEdit.ResolvedEntities[0]; // pickerEntity1.Key = "mycompany\jondoe" // pickerEntity1.Claim = null // pickerEntity1.DisplayText = "Doe, John"
I can do some “hacker” things, for example, try to pass the value of the returned string [sic] as a user or as a group and execute some program flow based on an exception (if the user exists, otherwise, if the group exists, etc. .), but I would not consider this clean code.
Is there a better way to select people / groups in Sharepoint or a better way to work with PeopleEditor?
c # sharepoint sharepoint-2010
Dennis g
source share