Thursday, April 11, 2013

asp.net Update Panel and hiding elements

When working on a asp.net application that was using multiple update panels I was getting an error something like


Could not find UpdatePanel with ID 'xxx'. If it is being updated dynamically then it must be inside another UpdatePanel

I found the post below on stack overflow.


Basically my issue was that I was hiding the <asp:Panel> that contained the update panel.  This does not work at all.  You cannot do

<asp:panel visible="false" runat="server">
     <asp:UpdatePanel runat="server">
          <ContentTemplate>
                    <div>some stuff</div>
         </ContentTemplate>
    </asp:UpdatePanel>
</asp:panel>

Once I removed the visible="false" from the <asp:Panel> that my <asp:UpdatePanel> and everything worked like a charm.






No comments:

Post a Comment