C# – UpdatePanel and Repeater render page unresponsive after post-back

asp.netcpostbackrepeaterupdatepanel

I have a page with an UpdatePanel that contains a Repeater and a text box with the number of items in the repeater. When I change the value, the page is supposed to post back and redraw the Repeater with the updated number of items. This works in principle, but the page ends up frozen after post-backs and does not accept any input – in IE 8 only. It works perfectly fine in Firefox. For instance, the context menu does not appear when I right-click in controls, and I cannot enter text in text boxes.

When I take out the UpdatePanel, the page works fine, but of course refreshes on every post-back event. This is not necessarily related to the Repeater on the page. I think I am seeing this on other pages. What's the trick here?

<asp:UpdatePanel ID="uPanel" runat="server" UpdateMode="Conditional" 
  EnableViewState="true" ChildrenAsTriggers="true">
  <ContentTemplate>
  <asp:Panel ID="Panel1" runat="server" DefaultButton="btnSubmit">
    <asp:TextBox ID="tbItems" runat="server" AutoPostback="true" 
                      OnTextChanged="textchanged_Items"/>                     
  <asp:Repeater id="rptItems" runat="server" 
           OnItemDataBound="repeaterItem_Databound">
        <...>
      </asp:Repeater>


    protected void textchanged_Items(object sender, EventArgs e) {
        try {
            // this methods rebinds the repeater to a List after changing
            // the number of items in the list
            ReflowItemRepeater();   
            // This is not really necessary, since Databind() appears to
            // cause an update. I tried it anyways.               
            uPanel.Update();
        }
        catch (Exception ex) {
            ShowError(this, "Error displaying the item list.", ex, true);
        }
    }

I ended up removing the update panel.

One month later, different page, I am still and again fighting this. The situation is the same.
An update panel, a repeater (actually 2 nested repeaters), and a control in the repeater that fires a postback event. The server processes the event correctly and returns control, but the browser (IE8) never refreshes the update panel. The page is unresponsive, as if in some sort of dead-lock situation. I can unlock it by clicking on a button that fires another postback event (also in the update panel). But the text boxes in the panel are not clickable or editable when this happens.
Also, it happens only the first time. Once I have "freed up" the lock, or whatever it is, it will not happen again on this page, even when I repeat the exact same steps that led to it.

When this happens, the JIT debugger does not report anything.

Best Answer

I would actually set Triggers within your updatepanel.

I'm not sure you need to call .Update in your code behind as the updatepanel will be updated when the trigger occurs.

Try this: