0

我在隐藏的 div 中有一个 C# Checkboxlist。div 在某些事件上显示,然后关闭。提交表单时,我尝试根据 checkboxlist.items 的选定值更新数据库位字段,但无论是否选中,它们总是返回 false。当包含项目的 div 被隐藏时,如何获取项目的选定值?

div 是我使用 jquery 显示/隐藏的对话框

 $(document).ready(function () {
        $('#<%=txtLANG.ClientID %>').click(function () {
            $("#overlay-back").dialog({
                resizable: false,
                modal: true,
                width: 500,
                height: 400,
                buttons: {
                    OK: function () {
                        GetLanguages();
                        $(this).dialog("close");
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }
            });
        });
    });

这是DIV ...代码隐藏只不过是根据复选框列表项的选定值将参数设置为真/假

<div id="overlay-back" style="display:none;">
        <table width="100%">
            <tr>
                <td width="50%">
                    <asp:CheckBox runat="server" ID="chkEnglish" TextAlign="Right" Text=" English" />
                    <div class="popup-container">
                            <img id="help_button_chkEnglish" class="help-button" src="/Images/help-button.png" alt="" />
                                <div class="help-popup hidden" id="help_popup_chkEnglish">
                                    <div class="popup-arrow-border"></div> <div class="popup-arrow"></div>
                                    <asp:Label runat="server" ID="lblLANGDesc"></asp:Label>
                                </div>
                        </div>
                </td>
                <asp:Panel runat="server" ID="pnlTopLanguages">
                <td rowspan="3" valign="top">
                    <asp:CheckBoxList ID="chkTopLanguages" TextAlign="Right" runat="server" />
                        <br />
                    <asp:Label runat="server" ID="lblNonTopLanguages"></asp:Label><br />
                    <asp:TextBox runat="server" ID="txtOtherLanguages" onkeypress="CopyOtherLangs(event)" onclick="clearLanguageSearchText()" Text="Other Languages..."></asp:TextBox>
                    <cc3:AutoCompleteExtender ID="aceSearch" runat="server" MinimumPrefixLength="1" TargetControlID="txtOtherLanguages"
                                                ServicePath="~/controls/wsCommunity.asmx" ServiceMethod="GetLanguageCompletionList">
                                        </cc3:AutoCompleteExtender>
                </td>
                <td rowspan="3">
                <div class="popup-container">
                            <img id="help_button_chkTopLanguages" class="help-button" src="/Images/help-button.png" alt="" />
                                <div class="help-popup hidden" id="help_popup_chkTopLanguages">
                                    <div class="popup-arrow-border"></div> <div class="popup-arrow"></div>
                                    <asp:Label runat="server" ID="lblTopLangs"></asp:Label>
                                </div>
                        </div>
                </td>
                </asp:Panel>
            </tr>
            <tr>
                <td>
                    <asp:CheckBox runat="server" ID="chkFrench" TextAlign="Right" Text=" French" />
                    <div class="popup-container">
                            <img id="help_button_chkFrench" class="help-button" src="/Images/help-button.png" alt="" />
                                <div class="help-popup hidden" id="help_popup_chkFrench">
                                    <div class="popup-arrow-border"></div> <div class="popup-arrow"></div>
                                    <asp:Label runat="server" ID="Label2"></asp:Label>
                                </div>
                        </div>
                </td>
            </tr>
            <asp:Panel runat="server" ID="pnlEnhancedFrench">
            <tr>
                <td valign="top">
                    <asp:CheckBoxList ID="chkEnhancedFrench" TextAlign="Right" CssClass="EnhancedFrench" runat="server">
                        <asp:ListItem> Customer Service</asp:ListItem>
                        <asp:ListItem> Publications</asp:ListItem>
                        <asp:ListItem> Website</asp:ListItem>
                        <asp:ListItem> Interpreters</asp:ListItem>
                    </asp:CheckBoxList>
                </td>
            </tr>
            </asp:Panel>
        </table>
        </div>
4

0 回答 0