// 填充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>");
            }
        }
    }

posted on 2006-12-15 23:12  ipusr  阅读(212)  评论(0)    收藏  举报