Toronto SharePoint Camp 2007 is only 3 days away – and we need your help.
If you have already registered to help us or if you are interested, then tonight is the right time to get more involved.Please join other volunteers at 6:00pm at the Toronto SharePoint User Group venue at 2 Bloor West, so that we can allocate job roles, functions, and responsibilities surrounding the event this Saturday.
Thank you in advance for donating your time to support the Toronto SharePoint Camp 2007.
See you tonight,
Assuming you have a people editor control defined like below:
<wssawc:PeopleEditor AllowEmpty=”false” ID=”myPeopleEditorControl” runat=server SelectionSet=”User” MaximumEntities=”1″ MultiSelect=”false” AllowTypeIn=”false” Width=’500px’ />
The following code sample will get you the currently logged on user’s login from the PeopleEditor control:
ArrayList peEntities = myPeopleEditorControl.Entities;
PickerEntity pickEn = (PickerEntity)peEntities;
stringLogIn = pickEn.Key;
This comes handy when you want to create an SPUser context out of the entities kept in the PeopleEditor control. For example:
private SPUser GetUser(string logIn)
SPUser user = this.workflowProperties.Web.SiteUsers[logIn];
Don’t forget Required Field Validation on your people editor control if you want the code not to break on you.