SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to add a people picker to my webpart according to an event. To make it simple I want to add it when I click a button. The code would be very simple, like this:

protected void Button1_Click(object sender, EventArgs e)
        PeopleEditor pe = new PeopleEditor();
        pe.ID = "CCC";

The People Editor suddendly appears but doesn't work as expected: when I try to use it, it raised an exception:

The target 'ctl00$m$g_bbed8d1e_42f3_4288_b8ac_ba7c95856727$ctl00$CCC' for the callback could not be found or did not implement ICallbackEventHandler.

There is something I had to register to make this work? I had to handle N people picker in my page so I cannot create it invisible and then make it visibile..

Any suggestion? Thank you!

share|improve this question
up vote 1 down vote accepted

When you work with dynamically added controls these controls must be programmatically added on each postback. In your case:

  • you try to use the people picker,
  • the people picker makes postback,
  • after the postback this control does not exists anymore.

I think you should create your controls in the OnInit event (for example check if there is postback and what is the source of this postback), and think of some way to track how many controls you need to recreate.

share|improve this answer

question already asked, please look at this as i think this is what your trying to do :)

How Can I Use the SharePoint People Picker Control in my Custom Web Part?

hope it helps!

share|improve this answer
I think instead of posting the link just mention a little description – Geek Jan 8 '13 at 22:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.