Checkboxlist snapping to top in asp.net

37 views Asked by At

I am using two checkboxlist. When an item from 1st is selected, the 2nd checkboxlist gets populated. I am using autopostback = true. However when I click an item from 1st checkboxlist, the list gets snapped back to top. I want to use autopostback = true, but the checkboxlist should not snap back to top.

<asp:UpdatePanel ID="upd" runat="server">
    <ContentTemplate>
        <div class="issuers">
            <div>
                <label>Issuer:</label><br />
                <asp:DropDownList ID="ddlIssuers" DataSource='<%# GetIssuers() %>'
                    runat="server" AppendDataBoundItems="false" OnSelectedIndexChanged="ddlIssuers_SelectedIndexChanged"
                    AutoPostBack="true"
                    DataTextField="Name" DataValueField="Id">
                </asp:DropDownList>
            </div>
            <div>
                <label>Club:</label><br />
                <asp:CheckBox runat="server" ID="cbAllClubs" Text="All Clubs" /><br />
                <asp:CheckBoxList ID="ddlClubs"
                    runat="server" AppendDataBoundItems="false" OnSelectedIndexChanged="ddlClubs_SelectedIndexChanged"
                    AutoPostBack="true"
                    DataTextField="Name" DataValueField="Id">
                </asp:CheckBoxList>
            </div>
            <div>
                <label>Account Definitions:</label><br />
                <asp:CheckBox runat="server" ID="cbAllAccountDefinitions" Text="All Account Definitions" /><br />
                <asp:CheckBoxList ID="cblAccountDefinitions"
                    runat="server" AppendDataBoundItems="false" OnSelectedIndexChanged="cblAccountDefinitions_SelectedIndexChanged"
                    AutoPostBack="false"
                    DataTextField="Name" DataValueField="Id">
                </asp:CheckBoxList>
                <asp:HiddenField ID="hiddenField" runat="server" />
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

I tried JQuery but couldn't quite figure out how to solve this problem

0

There are 0 answers