how can i get the people picker field in aspx page in sharepoint??
Thanks in advance,...
Technology Tips and News
how can i get the people picker field in aspx page in sharepoint??
Thanks in advance,...
If you are using .aspx page and want to use this page in sharepoint site then your can also use people editor control except textbox and button. (If you are fetching user from AD)
Add below line in your aspx page
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Add a user to the picker (c#):
ArrayList list = new ArrayList();
list.Add(
new PickerEntity()
{
Key = @"DOMAIN\User"
}
);
userPicker.UpdateEntities(list);
Retrieve selected user(s)(c#):
PickerEntity pe = (PickerEntity)userPicker.Entities[0];
string username = pe.Key;
//or if the entities are resolved
PickerEntity pe = (PickerEntity)userPicker.ResolvedEntities[0];
string username = pe.Key;
If you are using .aspx page and want to use this page in sharepoint site then your can also use people editor control except textbox and button. (If you are fetching user from AD)
Add below line in your aspx page
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Add a user to the picker (c#):
ArrayList list = new ArrayList();
list.Add(
new PickerEntity()
{
Key = @"DOMAIN\User"
}
);
userPicker.UpdateEntities(list);
Retrieve selected user(s)(c#):
PickerEntity pe = (PickerEntity)userPicker.Entities[0];
string username = pe.Key;
//or if the entities are resolved
PickerEntity pe = (PickerEntity)userPicker.ResolvedEntities[0];
string username = pe.Key;
If you are using .aspx page and want to use this page in sharepoint site then your can also use people editor control except textbox and button. (If you are fetching user from AD)
Add below line in your aspx page
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Add a user to the picker (c#):
ArrayList list = new ArrayList();
list.Add(
new PickerEntity()
{
Key = @"DOMAIN\User"
}
);
userPicker.UpdateEntities(list);
Retrieve selected user(s)(c#):
PickerEntity pe = (PickerEntity)userPicker.Entities[0];
string username = pe.Key;
//or if the entities are resolved
PickerEntity pe = (PickerEntity)userPicker.ResolvedEntities[0];
string username = pe.Key;