So I have this Checkboxlist and I want to implement a Select All feature for the elements inside it. I placed it inside an UpdatePanel, but everytime I click an item, the entire page is reloaded. This is my code:
<asp:UpdatePanel ID="CBLPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<div class="LeftAligned">
<asp:Label ID="FilterLabel" runat="server" Text="Filter by:" />
<asp:DropDownList runat="server" ID="FilterDDL" AutoPostBack="true" OnSelectedIndexChanged="FilterDDL_SelectedIndexChanged" />
<asp:ImageButton ID="FB" runat="server" ImageUrl="~/images/filter.png" AlternateText="VALUE"
CssClass="filter_button" OnClick="FB_Click" />
<div onmouseout="javascript:bMouseOver=false;" onmouseover="javascript:bMouseOver=true;"
class="filter_div">
<asp:CheckBoxList AutoPostBack="true" ID="FilterCheckBoxList" ClientIDMode="Static"
runat="server" CssClass="filter_checklist collapsed" OnSelectedIndexChanged="FilterCheckBoxList_Selected">
</asp:CheckBoxList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
I though I should set ChildrenAsTriggers to false and this way I would update only from the code, but it doesn't seem to work.
This looks like a familiar .NET Bug. Setting ClientIDMode=Auto on the CheckBoxList should fix it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With