Use PeopleEditor (People Picker) in SharePoint Custom App Dev
How to add the PeopleEditor (People Picker) control to your custom application development (ASPX, user controls, web parts, etc.)
The control we are interested in is the Microsoft.SharePoint.WebControls.PeopleEditor control.
First, we need to add a reference to the Namespace containing our control:
Next, add the PeopleEditor control to your page:
AllowEmpty="false"
ValidatorEnabled="true"
id="userPicker"
runat="server"
ShowCreateButtonInActiveDirectoryAccountCreationMode="true"
SelectionSet="User" />
Next, add an object on the server to work with the control:
public class MyPageName : Page
{
protected PeopleEditor userPicker;
…
}
Now, add your code needed to retrieve the entities:
{
….
PickerEntity pe = (PickerEntity)userPicker.Entities[0]; //gets first user in list
string username = pe.Description;
…
}
Notes:
The Description property will return the full account name (e.g. domain\username)
The DisplayText property will return the resolved name in the editor control (e.g. First Last)
----------------- Have A Nice Time !!! --------------------
3 comments:
Sharepoint allows tasks to be saved on a web server that can be utilized by employees from any location, enabling for real-time cooperation. Tight safety actions are set so that only certain individuals can accessibility these information. Customers can also create their own individual storage information which cannot be utilized by anyone but them. The smooth Sharepoint interface guarantees that information are not combined or lost and that the right individuals have accessibility the information they need.
Custom Application Development India
Interesting blog. It gives a lot of useful information.Thank you for sharing this.
Mobile Application development
Thanks Elite...
Post a Comment