日期:2014-05-17 浏览次数:20441 次
cblRole.DataTextField = "Name";
cblRole.DataValueField = "REMARK";
cblRole.DataSource = dt_Role.Copy();
cblRole.DataBind();
foreach (DataRow dr in dt_Role.Rows)
{
ListItem obj = new ListItem(dr["Name"].ToString(), dr["ID"].ToString());
cblRole.Items.Add(obj);
}
cblRole.DataBind();
<table id="cblRole" border="0">
<tbody>
<tr>
<td><input id="cblRole_0" type="checkbox" name="cblRole$0"><label for="cblRole_0">系统管理员</label></td>
<td><input id="cblRole_1" type="checkbox" name="cblRole$1"><label for="cblRole_1">VM管理员</label></td>
<td><input id="cblRole_2" type="checkbox" name="cblRole$2"><label for="cblRole_2">部门经理</label></td>
<td><input id="cblRole_3" type="checkbox" name="cblRole$3"><label for="cblRole_3">最终用户</label></td>
</tr>
</tbody></table>