简体   繁体   中英

How do I call a function with checked and unchecked a checkbox from a checkboxlist?

I have a checkboxlist and i have to call function which perforform db job while checked a particular checkbox and unchecked a particular box. Plz help me out !!!!

what about this, if it is a web application:

protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
        {
              if (CheckBoxList1.SelectedValue == "your value")
              {
                     //do logic
              }                       

        }

CheckBox.OnCheckedChanged Method (System.Web.UI.WebControls) Raises the CheckedChanged event of the CheckBox control. This allows you to handle the event directly.

CheckBox.CheckedChanged Event (System.Windows.Forms) CheckedChanged Event. Occurs when the value of the Checked property changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM