如何将动态创建的多个checkbox实例化
2个回答
2017-04-05
展开全部
var str=" <input title="+s+" type=checkbox checked value="+s+" >";
var newCheckbox = document.createElement(str);
document.getElementById("").insertBefore(newCheckbox);
CheckBox chkbox = new CheckBox();
chkbox.Name = "chk"+dr["id"].ToString();
chkbox.Text = dr["name"].ToString();
chkbox.CheckedChanged += new System.EventHandler(this.chkbox_CheckedChanged);
this.Controls.Add(chkbox);
private void chkbox_CheckedChanged(object sender, System.EventArgs e)
{ }
var newCheckbox = document.createElement(str);
document.getElementById("").insertBefore(newCheckbox);
CheckBox chkbox = new CheckBox();
chkbox.Name = "chk"+dr["id"].ToString();
chkbox.Text = dr["name"].ToString();
chkbox.CheckedChanged += new System.EventHandler(this.chkbox_CheckedChanged);
this.Controls.Add(chkbox);
private void chkbox_CheckedChanged(object sender, System.EventArgs e)
{ }
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询