// 填充CheckBoxList的Item
protected void FillPower()
{
string strSQL = "select distinct student_id,student_name from student";
DataSet ds;
ds = DAL.DbHelperSQL.Query(strSQL);
cbl.DataSource = ds.Tables[0].DefaultView;
cbl.DataTextField = "student_name";
cbl.DataValueField = "student_id";
cbl.DataBind();
}
一些属性的
protected void a_Click(object sender, EventArgs e)
{
for (int i = 0; i < cbl.Items.Count - 1; i++)
{
if (cbl.Items[i].Selected == true)
{
this.Response.Write("<script>alert('"+cbl.Items[i].Value+"');</script>");
}
}
}
浙公网安备 33010602011771号