I am using the below code in my application page to get the the Display name from people picker. but it is returning as null can you please help me in this regard.
However if i use SPUSER object iam able to get the USername. Commented code in the below method. Note: I was able to fetch the Email with out using the spuserobject.
for (int i = 0; i < userPicker.ResolvedEntities.Count; i++)
{
PickerEntity picker = (PickerEntity)userPicker.ResolvedEntities[i];
//string username = picker.Description;
//SPUser user = mySiteWeb.EnsureUser(username);
//string displayname = user.Name;
Hashtable hstEntityData = picker.EntityData;
string emailID = Convert.ToString(hstEntityData["Email"]);
String DisplayName = Convert.ToString(hstEntityData["DisplayName"]);
Emailarray.Add(emailID);
}