This is not a full coding, its more like hints.
However, I do feel that it is almost near a full coding.
try to fill in the blanks for the rest.
Every control in ASP.NET has a property called
AutoPostBack
.
AutoPostBack is functioned like a button's click event.
If there is any changes made to control, it will carry out a postback event.
Next, the ASP.NET control need a
action event
for you to handle in code behind.
In your case, you need the CheckBoxList's
SelectedIndexChanged
action event.
Example of coding in ASP.NET page:
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True"
onselectedindexchanged="CheckBoxList1_SelectedIndexChanged">
</asp:CheckBoxList>
This will handle the postback event of selected index changed:
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
Example of coding in code behind
protected void Page_Load(object sender, EventArgs e)
{
CheckBoxList1.AutoPostBack = true;
CheckBoxList1.SelectedIndexChanged += new EventHandler(CheckBoxList1_SelectedIndexChanged);
}
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
}