我使用textbox,checkboxlist,panel和popupcontrolextender创建了一个多选下拉列表控件。我已将所有控件放在UpdatePanel中。现在,当我检查CheckBoxList中的一个复选框时,CheckBoxList的SelectedIndexChanged被触发但是当我取消选中它时它不会被触发。但是,当我在我的给定代码中删除PopupControlExtender后尝试时,此事件正在正确触发。我认为PopupControlExtender导致了这个问题。关于这个的任何想法?
以下是代码:
<asp:UpdatePanel ID="updatepanelBizUnit" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtBizUnit" runat="server" Width="147px" ReadOnly="true" TabIndex="1"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequiredBizUnit" CssClass="validatorMessage" Display="Dynamic"
ValidationGroup="VgroupPart" runat="server" ErrorMessage="The 'Business Unit' field is required."
Text="*" ControlToValidate="txtBizUnit" ForeColor="" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:PopupControlExtender ID="txtBizUnit_PopupControlExtender" runat="server" Enabled="True"
ExtenderControlID="" TargetControlID="txtBizUnit" PopupControlID="PnlBizUnit"
OffsetY="14">
</asp:PopupControlExtender>
<asp:Panel ID="PnlBizUnit" runat="server" Height="116px" Width="145px" BorderStyle="Solid"
BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#FFFFFF"
Style="display: none">
<asp:CheckBoxList ID="ChkBizUnit" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ChkBizUnit_SelectedIndexChanged">
</asp:CheckBoxList>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ChkBizUnit" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>