Monday, September 17, 2012

PeoplePicker related issue in custom Layouts pages after SharePoint June 2011 CU



If you are using PeopleEditor AKA PeoplePicker in custom layout pages and have installed SharePoint 2010 SP1 and the June 2011 CU you may experience problems if your application page performs a postback.

If you have filled your people editor control with a value before a postback is triggered, it will stop functioning as an actual picker and if you perform another postback on the page you will get an errormessage: “String was not recognized as a valid Boolean”.

The reason seems to be that a lot of span tags are not regenerated after the first postback.
The only descent fix so far seems to be to validate the PeopleEditor control in the page OnLoad event:

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (IsPostBack)
    {
        yourPeopleEditor.Validate();
    }
}

Contact me

Name

Email *

Message *

Total Pageviews