asp.net updatepanel inside hidden panel possible bug

Posted by MakkyNZ on Stack Overflow See other posts from Stack Overflow or by MakkyNZ
Published on 2010-05-27T02:41:05Z Indexed on 2010/05/27 2:41 UTC
Read the original article Hit count: 469

Filed under:
|
|
|

Hi

The javascript generated by the asp.net SciptManager control seems to have a bug and cant handle hidden UpdatePanels. A javascript error is thrown when a control within one updated panel tries to make another update panel visible. Is this a bug with ASP.Net ajax? And does anyone have any ideas how to get around this?

heres is an example of when im trying to to

<script type="text/C#" runat="server">
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Panel1.Visible = true;
    }
</script>

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" Text="Show Panel"></asp:LinkButton>
    </ContentTemplate>
</asp:UpdatePanel>

<asp:Panel ID="Panel1" runat="server" Visible="false">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            blah bla blah
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>

this is the javascript error that gets thrown when clicking on the "LinkButton1" link. This error comes from the javascript that is generated by the asp.net ScriptManager control

Error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ContentPlaceHolder1_UpdatePanel2'

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript