Problem when you have two update panels on the a page and one is called UpdatePanel1

Last post 10-12-2006 9:55 AM by Garbin. 1 replies.

Sort Posts:

  • Problem when you have two update panels on the a page and one is called UpdatePanel1

    10-12-2006, 4:35 AM

    Hi,

    First of all I use the Altas July CTP version of the Assembly is Version 2.0.50727.0 

    Here the situation. I have a page that contains two updatePanels(ID=UpdatePanel1 and UpdatePanel2) that each contains a label. Then I have two buttons that is used to update each panel so this mean put something in the label control. The Mode of the updatePanel are set to Conditional.  See source for more information.

    So when i click on the button to updatepanel1 then the label is changed  but everything else on the page is gone(The Buttons).  I did do some research and when I change the ID for UpdatePanel1 to UpdatePanel50 everything works.

    So when you have an updatePanel that has the ID UpdatePanel1 You will run in to problems with the july CTP.

     Another issue is when you change the Mode property of the updatePanel to Alway then you will retrieve an javascript error

    Here is the source code

    <%@ Page Language="VB" AutoEventWireup="true"  %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <script runat="server">

    Protected Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click

    label1.Text = DateTime.Now

    End Sub

    Protected Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)

    label2.Text = DateTime.Now.AddYears(1)

    End Sub

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body id="updatePanel1">

    <form id="form1" runat="server">

    <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

     

    <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" >

    <ContentTemplate>

    <asp:Label ID="label1" runat="server"></asp:Label>

    </ContentTemplate>

    <Triggers>

    <atlas:ControlEventTrigger ControlID="button1" EventName="Click" />

    </Triggers>

    </atlas:UpdatePanel>

    <asp:Button ID="button1" runat="server" Text="GetDate" />

     

    <!--This is panel 2-->

    <atlas:UpdatePanel ID="UpdatePanel20" runat="server" Mode="Conditional">

    <ContentTemplate>

    <asp:Label ID="label2" runat="server"></asp:Label>

    </ContentTemplate>

    <Triggers>

    <atlas:ControlEventTrigger ControlID="button2" EventName="Click" />

    </Triggers>

    </atlas:UpdatePanel>

    <asp:Button ID="button2" runat="server" OnClick="button2_Click" Text="GetDate2" />

    </form>

    </body>

    </html>

  • Re: Problem when you have two update panels on the a page and one is called UpdatePanel1

    10-12-2006, 9:55 AM
    • Loading...
    • Garbin
    • Joined on 09-17-2004, 8:35 AM
    • Sassari, Italy
    • Posts 1,495
    • ASPInsiders
      TrustedFriends-MVPs

    Hi,

    what happens if you change the id of the <body> element from "updatePanel1" to something else?

    Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter