*** do c# do ****
Page_Load vago protegido (remetente do objeto, EventArgs e)
{
se (! IsPostBack)
CreateCtrls ();
}
CreateCtrls vago confidencial ()
{
DropDownList ddl1 = DropDownList novo ();
ddl1.ID = “ddl1”;
ddl1.Items.Add (“asdf0”);
ddl1.Items.Add (“asdf1”);
ddl1.Items.Add (“asdf2”);
ddl1.Items.Add (“asdf3”);
pnl. Controls.Add (ddl1);
DropDownList ddl2 = DropDownList novo ();
ddl2.ID = “ddl2”;
ddl2.Items.Add (“lkjh0”);
ddl2.Items.Add (“lkjh1”);
ddl2.Items.Add (“lkjh2”);
ddl2.Items.Add (“lkjh3”);
pnl. Controls.Add (ddl2);
ViewState [“ControlsAdded2”] = retifica;
}
btn1_Click vago protegido (remetente do objeto, EventArgs e)
{
}
vácuo protegido LoadViewState da ultrapassagem (savedState do objeto)
{
base.LoadViewState (savedState);
se (zero do == de ViewState [“controlsadded1”])
{
CreateCtrls ();
}
}
*** do aspx do ****
|