62,268
社区成员
发帖
与我相关
我的任务
分享
<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;
}
}
foreach (Control ct in Master.FindControl("DIVcheck").Controls)
{
}