Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ListBox inside a Repeater inside a modalpopup hides the modalpopup

$
0
0

Hello,

I have a Repeater inside a modalpopup, and ListBoxes inside the Repeater. The problem is, when I select an item in the ListBox the modalpopup hides. I'm under the impression that this isn't supposed to happen when the modalpopup's content is surrounded by an updatepanel. Also, this problem only started appearing a while ago. Here is a simplified code sample that produces the problem:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %><asp:HiddenField ID="hf1" runat="server" /><cc2:ModalPopupExtender ID="mpe_test" runat="server" TargetControlID="hf1"
    PopupControlID="panel_test" /><asp:Panel ID="panel_test" runat="server" Style="display: none; background-color: white; border: 1px solid black;"><asp:UpdatePanel runat="server"><ContentTemplate><asp:Repeater ID="rep_test" runat="server"><ItemTemplate><asp:ListBox ID="lb_inside" runat="server" AutoPostBack="true"><asp:ListItem Text="1" Value="1" /><asp:ListItem Text="2" Value="2" /></asp:ListBox><asp:DropDownList ID="ddl_inside" runat="server" AutoPostBack="true"><asp:ListItem Text="1" Value="1" /><asp:ListItem Text="2" Value="2" /></asp:DropDownList></ItemTemplate></asp:Repeater><asp:ListBox ID="lb_outside" runat="server" AutoPostBack="true"><asp:ListItem Text="1" Value="1" /><asp:ListItem Text="2" Value="2" /></asp:ListBox><asp:DropDownList ID="ddl_outside" runat="server" AutoPostBack="true"><asp:ListItem Text="1" Value="1" /><asp:ListItem Text="2" Value="2" /></asp:DropDownList></ContentTemplate></asp:UpdatePanel></asp:Panel><asp:Button ID="btn_test" runat="server" Text="test" OnClick="btn_test_click" />

protected void btn_test_click(object sender, EventArgs e)
{
    rep_test.DataSource = new List<int> { 1 };
    rep_test.DataBind();
    mpe_test.Show();
}

Selecting items from lb_outside or ddl_outside doesn't hide the modalpopup. When selecting items from lb_inside or ddl_inside, the behaviour interestingly depends on the browser:

- On Chrome, ListBox hides the modalpopup but DropDownList doesn't

- On IE, DropDownList hides the modalpopup but ListBox doesn't

- On Firefox, both of the controls hide the modalpopup

Calling mpe_test.Show() from OnSelectedIndexChanged-event doesn't help. Also, I noticed that removing the ID:s from lb_outside and ddl_outside causes lb_outside to start hiding the modalpopup in Chrome and Firefox and ddl_outside in IE and Firefox.

Any ideas what's going on?


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>