日期:2014-05-17 浏览次数:20472 次
DropDownList ddl = new DropDownList(); ddl.ID = "d1"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); ddl.Items.Add(new ListItem("a","1")); ddl.Items.Add(new ListItem("b","2")); Panel1.Controls.Add(ddl)
protected void ddl_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; Response.Write(ddl.SelectedValue); }