日期:2014-05-18 浏览次数:20546 次
<td class="forumrowhighlight"> <div id="DIVcheck" runat="server"> </div> </td>
DataSet ds = ActionBLL.GetAllList();
foreach (DataRow dr in ds.Tables[0].Rows)
{
CheckBox ck = new CheckBox();
HtmlGenericControl div = new HtmlGenericControl("div");
DIVcheck.Controls.Add(div);
ck.Text = dr["action_name"].ToString();
ck.ID = dr["action_id"].ToString();
div.Style.Value = "float:left;width:150px";
div.Controls.Add(ck);
}
ds.Dispose();
foreach (Control ct in this.Master.Controls)
{
if (ct is CheckBox)
{
CheckBox ck = (CheckBox)ct;
}
}