ASP.NET: UpdateProgress does not work with controls that have ClientIDMode = "Static"

Take a look at this markup:

<asp:UpdatePanel ID="Panel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DropDownList ID="cboBox1" ClientIDMode="Static" AutoPostBack="true" runat="server" /> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DropDownList ID="cboBox2" runat="server" /> <asp:UpdateProgress ID="UpdateProgress1" style="display: inline" AssociatedUpdatePanelID="Panel1" DynamicLayout="false" DisplayAfter="0" runat="server"> <ProgressTemplate> <img src='<%= ResolveClientUrl("~/Images/indicator.gif")%>' border="0" alt="" /> </ProgressTemplate> </asp:UpdateProgress> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="cboBox1" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> 

The UpdateProgress control worked initially, but it broke when we added ClientMode = "Static" to cboBox1. Returning it back to AutoID is not an option, so I need to find solutions that allow UpdateProgress panels to work with ClientIDMode = "Static".

Also, can anyone add "clientidmode" to the tag list?

+7
source share
1 answer

This seems to be a bug in PageRequestManager , since postBackElement not passed to the beginRequest handler. For this particular problem, you can use the following script:

 $(function () { $("#cboBox1").live("change", function () { window.setTimeout(function () { var progress = $find("<%= UpdateProgress1.ClientID %>"); // since you use 0 DisplayAfter property value you may // just call progress.set_visible(true); // without timeout usage window.setTimeout(function () { progress.set_visible(true); }, progress.get_displayAfter()); }, 0); }); }); 
+2
source

All Articles