SharePoint: How To Deal With People Picker Sharepoint Control into your Custom Asp.net Control


 

In Many Cases you need to make a control to pick up a user from your user management system – Active Directory – Database Membership and so on, PeopleEditor Control make this job.now you will say how to use it in my custom development,look

1)  Add Refernce to your HTML

<%@ Register Tagprefix=”SP” Namespace=”Microsoft.SharePoint.WebControlsAssembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

2) Use it in the right position into your design

<SP:PeopleEditor
AllowEmpty=”false
ValidatorEnabled=”true
id=”Picker
runat=”server
ShowCreateButtonInActiveDirectoryAccountCreationMode=”true
SelectionSet=”User” />

3) Get Values from it into your code behind 

PickerEntity pe = (PickerEntity)userPicker.Entities[0];  //get the first user in list
string username = pe.Description; //get username of the selected user

string DisplayName = pe.DisplayText ; //get user display name first last….

Regards,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s