简体   繁体   English

如何在复选框列表中选中和取消选中复选框的情况下调用函数?

[英]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: 如果是Web应用程序,该怎么办:

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. CheckBox.OnCheckedChanged方法(System.Web.UI.WebControls)引发CheckBox控件的CheckedChanged事件。 This allows you to handle the event directly. 这使您可以直接处理事件。

CheckBox.CheckedChanged Event (System.Windows.Forms) CheckedChanged Event. CheckBox.CheckedChanged事件(System.Windows.Forms)CheckedChanged事件。 Occurs when the value of the Checked property changes. 在Checked属性的值更改时发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 读取CheckBoxList复选框的状态(已检查/未检查) - Reading the status (Checked/Unchecked) of a CheckBoxList checkbox 如何在页面加载中将我的默认日期设置为默认复选框,而不是全选? - How do I set my default checked checkbox on pageload for my latest date in checkboxlist instead of select all? 如果选中了checkboxlist1中的特定列表项,如何禁用checkboxlist2中的某些复选框? - How to disable certain checkbox items in checkboxlist2 if a specific list item from checkboxlist1 is checked? 如何使用Silverlight在代码隐藏中的复选框中添加“选中” /“未选中”事件处理程序? - How do I add a 'checked'/'unchecked' event handler to a checkbox in codebehind using Silverlight? 当我取消选中复选框时,它将起作用 - checkboxlist when i do unchecked , it will work true 如何在选中Checkbox时调用javascript函数 - How can I call a javascript function when Checkbox is checked 如何检查是否从类文件中的表单上选中了复选框? - How do I check if a checkbox is checked on a form from a class file? 将复选框设置为在Repeater / CheckboxList中选中 - Set checkbox as checked in Repeater/CheckboxList 如何知道(动态地)选中了复选框列表项? - How to know the checkboxlist items (from dynamically) are checked or not? 如何设置if复选框已选中的语句? - How do I setup an if checkbox checked statement?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM