We all are aware of peoplepicker control.
Today we will discuss how to set its value from code and how to retrieve it.
Suppose we have a peoplepicker control named: pplowner
Setting Value to PeoplePicker from code:
pplOwner.CommaSeparatedAccounts = "EUNET\USERNAME";
If you wish to put the current logged in user name in peoplepicker, you can use:
Fetching Value of PeoplePicker from code:
if (pplOwner.Accounts.Count > 0)
string userid= pplOwner.Accounts.ToString();
You can also iterate the usernames in peoplepicker as;
for (int i=0; i<pplowner.Accounts.Count;i++)