Link to the PPT Slides :
Please keep checking my blog site for more webinars and useful articles.
There are three section we need to configure to make it work i.e. Provided Hosted App in SharePoint Online.1. Create Visual Studio Project using SharePoint Add in Template2. Create Azure Web App for Hosting purpose3. Generate the Client Id and Client Secret using https://<<SiteCollection>>/_layouts/AppRegNew.aspx4. Set generated client Id and Client Secret in VS Solution Web.Config.5. Set Client Id and Client Secret in Azure Web App using Old Portal.
Get value from People Picker Control
Note: - people picker control pass as parameter.
|
public string
GetPeoplePickerValue(PeopleEditor peoplePicker)
{
string userValue = string.Empty;
try
{
if
(peoplePicker.ResolvedEntities.Count.Equals(1))
{
PickerEntity pickerAppEntity = (PickerEntity)peoplePicker.ResolvedEntities[0];
userValue = pickerAppEntity.Key;
}
}
catch (Exception)
{
throw;
}
return userValue;
}
|
Set value to People picker control
Note:- People Picker Control pass as parameter and value as
SPListItem Object , where Web object can also pass as parameter.
|
public void
SetPeoplePickerValue(PeopleEditor peoplePicker, object value)
{
try
{
if (value != null)
{
SPWeb
edgeWeb = SPContext.Current.Web;
string
user = Convert.ToString(value);
SPFieldUserValueCollection userCol = new SPFieldUserValueCollection(edgeWeb, user);
peoplePicker.CommaSeparatedAccounts = Convert.ToString(userCol[0].User);
peoplePicker.Validate();
}
}
catch (Exception)
{
throw;
}
}
|