复选框在隐藏的div中选中

时间:2013-04-02 19:07:05

标签: c# asp.net checkbox checkboxlist

我在隐藏的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 ......代码隐藏只不过是根据checkboxlist项的选定值将参数设置为true / false

<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>

0 个答案:

没有答案