AJAX的ComboBox - 下拉按钮失踪按钮、AJAX、ComboBox

2023-09-11 01:35:23 作者:对不起姑娘

使用AJAX的组合框的手风琴控制内。事实上,嵌套在另一个手风琴其手风琴控制,如果这可能是一个问题。

Using an AJAX combobox inside of an accordion control. In fact, its an accordion control nested inside another accordion, if that could be a problem.

无论如何 - 我有两个组合框 - 放在了第一位,好像在任何网页提交的下拉按钮,查看可用的项目列表中消失。上的第二个,其从不存在。

Anyway -- I have two combo boxes - on the first one it seems like on any page postback the drop down button to see the list of available items disappears. On the second one, its never there.

下面是code:

  <asp:AccordionPane ID="Pane1" runat="server" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" >

<Header>
QUERY VIEW
</Header>

<Content>


        <asp:Label ID="lbl_chkOne" CssClass="label" runat="server" Text="By User" ></asp:Label>
            <input id="chk_One" type="checkbox" onclick="changePane(0,this)" groupKey="query" />
        <asp:Label ID="lbl_chkTwo" CssClass="label" runat="server" Text="All Users" ></asp:Label>
            <input id="chk_Two" type="checkbox" onclick="changePane(1,this)" groupKey="query" />
        <asp:Label ID="lbl_chkThree" CssClass="label" runat="server" Text="Other" ></asp:Label>
            <input id="chk_Three" type="checkbox" onclick="changePane(2,this)" groupKey="query" />
            <br />
            <br />
            <asp:Accordion ID="InnerAccordion" runat="server">
            <Panes>
            <asp:AccordionPane ID="Pane3" runat="server" Visible="true" >
            <Content>
                    <asp:Panel ID="Panel1" runat="server">
        <asp:Label ID="Label2" runat="server" Text="Select a User:" 
                    Style="margin-left:28px" ></asp:Label>

                    <asp:ComboBox ID="cbox_User" runat="server" AutoCompleteMode="SuggestAppend">
                    </asp:ComboBox>
                <asp:Label ID="Label3" runat="server" Text="Select a Month:" 
                                Style="margin-left:28px" ></asp:Label>
            <asp:TextBox ID="txt_Date" runat="server"></asp:TextBox>
             <asp:Label ID="Label1" runat="server" Text="Enter a Price:" 
                                Style="margin-left:28px" ></asp:Label>
             <asp:TextBox ID="txt_Price" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" 
                            TargetControlID="txt_Date" 
                            Format="MMMM yyyy" 
                            OnClientShown="onCalendarShown"
                            OnClientHidden="onCalendarHidden"
                            BehaviorID="calendar1" >
                </asp:CalendarExtender>
                <br />
                </asp:Panel>
            </Content>
            </asp:AccordionPane>
            <asp:AccordionPane ID="Pane4" runat="server" Visible="true" >
            <Content>
              <asp:Panel ID="Panel4" runat="server">
                <asp:Label ID="Label10" runat="server" Text="Select a Group:" 
                    Style="margin-left:28px" ></asp:Label>

                    <asp:ComboBox ID="cbox_Group" runat="server" >
                    <asp:ListItem Text="All Groups"> </asp:ListItem>
                    <asp:ListItem Text="Customers" > </asp:ListItem>
                    <asp:ListItem Text="Employees" > </asp:ListItem>
                    </asp:ComboBox>

                <asp:Label ID="Label11" runat="server" Text="Select a Month:" 
                                Style="margin-left:28px" ></asp:Label>
                <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
             <asp:Label ID="Label12" runat="server" Text="Enter a Price:" 
                                Style="margin-left:28px" ></asp:Label>
             <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>

                <br />
        </asp:Panel>
            </Content>

cbox_User是一个最初显示的按钮,然后消失在回发。 cbox_Groups是一个永远不会显示该按钮。

cbox_User is the one that initially displays the button and then it disappears on postback. cbox_Groups is the one that never shows the button.

下面是落后于code结合数据cbox_User:

Here is the code behind that binds data to cbox_User:

        protected void BindUsers()
    {
        IQueryable<AqUser> query = from users in db.AqUser
                                   orderby users.username
                                   select users; 

        cbox_User.DataSource = query;
        cbox_User.DataTextField = "username";
        cbox_User.DataValueField = "username"; 
        cbox_User.DataBind(); 
    }

   protected void Page_Load(object sender, EventArgs e)
    {
        db = new DBEntities();
        BindUsers();

        if (!Page.IsPostBack)
            OuterAccordion.Panes[1].Visible = false;
        else
            OuterAccordion.Panes[1].Visible = true; 
    }

我找不到太多关于这个除了一些帖子在互联网上它possibily被涉及到的div / CSS定位。

I couldn't find much on the internet about this except for some posts about it possibily being related to divs / css alignment.

任何想法?

推荐答案

绝不可能解决这个问题。必须是一个大的,他们需要修复。

Never could solve this. Must be a big they need to fix.

我用DropDownList的,而不是组合框,它工作正常。

I used DropDownList instead of ComboBox and it works fine.