I was hoping for some help with a UpdatePanel issue. I have read alot that they can be quite troublesome but this one has me baffled.

If i put two update panels on a page, one having triggers that affect the controls inside it then all is fine and the panels work as they should. However if i put some VB code around one of the UpdatePanel and tell it not to display on the page. Then the other stops working. Is there any reason for this? Is this not the correct way to use logic for page manipulation?

ASP Code:

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="NewOrder.aspx.vb" Inherits="WebApplication1.NewOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="Server" />

<%If False Then%>
<asp:updatepanel id="Updatepanel1" runat="server">
<ContentTemplate>
<asp:Label ID="LB1" Text="Label1" runat="server" />
</ContentTemplate>
</asp:updatepanel>
<%End If%>


<asp:updatepanel id="Updatepanel2" runat="server">
<ContentTemplate>
<asp:TextBox id="TB1" AutoPostBack="true" runat="server"/>
<asp:TextBox id="TB2" runat="server" />
</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID = "TB1" />
</Triggers>
</asp:updatepanel>

</asp:Content>

VB.NET Code:

Public Class NewOrder
Inherits System.Web.UI.Page

Protected Sub TB1_TextChanged(sender As Object, e As EventArgs) Handles TB1.TextChanged
TB2.Text = TB1.Text
End Sub
End Class


If you change the line <%If False Then%> to <%If True Then%> then all works fine and dandy, otherwise total failure.

Any help would be greatly appreciated on this one.

Thanks

Chris