title: Control scope within Repeater, with and without UpdatePanel
body: <p>Why does the following give me a compilation error for line B (Label2, outside UpdatePanel) but not for line A (Label1, inside UpdatePanel)? I would have expected both lines to give an error since both controls are within the same Repeater and should therefore not be directly accessible outside the repeater, since there is no one unique instance.</p>
  
  <pre><code>&lt;script runat="server"&gt;
      protected void Page_Load(object sender, EventArgs e)
      {
          Label1.Text = Label1.ClientID;  // Line A - compiles fine
          Label2.Text = Label2.ClientID;  // Line B - "The name 'Label2' does not exist in the current context"
      }
  &lt;/script&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;Untitled Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;div&gt;
              &lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt;
              &lt;asp:Repeater runat="server" ID="Repeater1"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:UpdatePanel runat="server" ID="UpdatePanel1"&gt;
                          &lt;ContentTemplate&gt;
                              &lt;asp:Label ID="Label1" runat="server" Text="Label1" /&gt;
                          &lt;/ContentTemplate&gt;
                      &lt;/asp:UpdatePanel&gt;
                      &lt;asp:Label ID="Label2" runat="server" Text="Label2" /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:Repeater&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>