【问题标题】:CheckBoxList item checked EventCheckBoxList 项目选中事件
【发布时间】:2013-08-28 11:26:53
【问题描述】:

我正在实施checkboxlist,如果选中\未选中任何项目,无论是哪个项目,我都想发起一个活动。如何做到这一点,请帮忙。

【问题讨论】:

  • 您可以将事件挂钩到每个 CheckedChanged 复选框项目。在这种情况下,您将检索组合框索引以了解您正在处理的是哪一个
  • 我也在动态填充复选框列表:p
  • 您也可以在代码后面分配事件。

标签: c# asp.net checkboxlist


【解决方案1】:

根据MSDN

<asp:RadioButtonList id="RadioButtonList1" 
            OnSelectedIndexChanged="Index_Changed"
            AutoPostBack="true"
            runat="server"/>

void Index_Changed(Object sender, EventArgs e) 
{
         Label1.Text = "You selected " + RadioButtonList1.SelectedItem.Text +
                     " with a value of $" + RadioButtonList1.SelectedItem.Value +
                     ".";
}

CheckBoxList 也应该如此。

【讨论】:

    猜你喜欢
    • 2011-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多