public void BindHTMLCheckedList(HtmlInputCheckBox theCheckBox, DataTable theDT) { int i = 0; for (i = 0; i < theDT.Rows.Count; i++) { System.Web.UI.WebControls.CheckBox theChkBox = new System.Web.UI.WebControls.CheckBox(); theCheckBox.ID = theDT.Rows[i][0].ToString(); theCheckBox.Value = theDT.Rows[i][1].ToString(); theCheckBox.DataBind(); theCheckBox.Controls.AddAt(i, theCheckBox); } }