CheckBoxList item checked Event

Moon picture Moon · Aug 28, 2013 · Viewed 12.3k times · Source

I'm implementing a checkboxlist, if any Item is checked\unchecked, irrespective of which one was is it, I want to launch an event. How this could be done, Please help.

Answer

insomnium_ picture insomnium_ · Aug 28, 2013

According to 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 +
                     ".";
}

The same should work on CheckBoxList too.