<pre lang="c#"> <asp:CheckBoxList ID="Student" class="checkS" align="left" runat="server" onselectedindexchanged="Student_SelectedIndexChanged" AutoPostBack="true" > <asp:ListItem Text="Insert" Value="Insert" ></asp:ListItem> <asp:ListItem Text="Update" Value="Update"></asp:ListItem> <asp:ListItem Text="View" Value="View"></asp:ListItem> <asp:ListItem Text="All" Value="Delete"></asp:ListItem> </asp:CheckBoxList>
protected void Student_SelectedIndexChanged(object sender, EventArgs e) { foreach (ListItem li in Student.Items) { // li.Selected = true; if (li.Text == "All" && li.Selected == true) { foreach (ListItem li1 in Student.Items) { li1.Selected = true; } } if ((li.Text == "Insert" && li.Selected == true)|| (li.Text == "Update" && li.Selected == true)) { Student.Items.FindByText("View").Selected = true; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)