lunedì 22 agosto 2011

Creare un Using the SharePoint People Picker

public class PeoplePickerWebPart : System.Web.UI.WebControls.WebParts.WebPart

{

PeopleEditor pe;

TextBox t;

Button b;



protected override void CreateChildControls()

{

base.CreateChildControls();

pe = new PeopleEditor();





this.Controls.Add(pe);

b = new Button();

b.Text = "Click me to see the users";

this.Controls.Add(b);

b.Click += new EventHandler(b_Click);

t = new TextBox();

t.TextMode = TextBoxMode.MultiLine;

this.Controls.Add(t);

}



void b_Click(object sender, EventArgs e)

{

foreach(string ent in pe.CommaSeparatedAccounts.Split(','))

{

t.Text += ent + Environment.NewLine;

}

}



Nessun commento:

Posta un commento