title: Is it possible to use a control in a different content tag as a parameter?
body: <p>I currently have two Web Controls, one being a CheckBoxList, and the other a GridView. The GridView's data configuration has a parameter in it's query which is linked to the selected values from the CheckBoxList. However, when the two controls are in separate content tags like so:  </p>
  
  <pre><code>&lt;asp:Content ID="ListPanel" runat="server" ContentPlaceHolderID="LeftContent"&gt;
      &lt;h3&gt;Pick Info Here&lt;/h3&gt;
      &lt;asp:CheckBoxList ID="cbList1" runat="server" 
          DataSourceID="TestDataSource" 
          DataTextField="St" DataValueField="St" RepeatColumns="2"&gt;
      &lt;/asp:CheckBoxList&gt;
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="ResultsPanel" runat="server" ContentPlaceHolderID="RightContent"&gt;
      &lt;asp:GridView ID="gView1" runat="server" 
          AllowPaging="True" AllowSorting="True" 
          AutoGenerateColumns="False" DataSourceID="TestDS1"&gt;
          &lt;Columns&gt;
           ... 
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
      &lt;asp:SqlDataSource ID="TestDS1" runat="server" 
      ... 
      SelectCommand="SELECT ST FROM [Table] where ST = ?"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:ControlParameter ControlID="cbList1" Name="?" 
              PropertyName="SelectedValue" /&gt;
      &lt;/SelectParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>It works fine when I put both controls in the same <code>&lt;asp:Content&gt;</code> tag, but things call apart with an error of <code>System.InvalidOperationException: Could not find control 'cbList1' in ControlParameter '?'</code>. Is there a way to keep the controls separate, or do they have to be inside the same content tag?</p>