title: ControlParameter can't find control which is in a UserControl
body: <p>I am fairly new to ASP.NET, but have been rolling right along, able to get past all hurdles thus far, with a little research. But I've got a little issue that I can't seem to get around, involving a custom control I've created.</p>
  
  <p>The control is a little widget that pops-up via JQuery and contains controls for allowing the user to filter on a result set. I had all the elements of this pop-up embedded within two specific pages, and those pages were each working fine. I decided to create a custom control, and have done so correctly, so far as I can tell, using an ascx file with <code>Control' directive and a</code>Register' directive on the target page, so:</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PopUp_TopicFilterControl.ascx.cs" Inherits="POD.PopUp_TopicFilterControl" %&gt;
  </code></pre>
  
  <p>And</p>
  
  <pre><code>&lt;%@ Register TagPrefix="popup" TagName="TopicFilterControl" Src="~/Controls/PopUp_TopicFilterControl.ascx" %&gt;
  </code></pre>
  
  <p>The `main' page contains an object datasource which needs to reference controls within my custom control for its select parameters. Here's the datasource:</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="TopicDataSource" runat="server" SelectMethod="GetRecentTopics" TypeName="POD.App_Objects.Topic"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:Parameter DefaultValue="12" Name="select_limit" Type="Int32" /&gt;
          &lt;asp:ControlParameter DefaultValue="" ControlID="TopicCategoryFilterList" Name="category" Type="String" /&gt;
          &lt;asp:ControlParameter DefaultValue="" ControlID="TopicCreatorFilterList" Name="creator" Type="Int32" /&gt;
          &lt;asp:ControlParameter DefaultValue="" ControlID="TopicDateAfterFilterText" Name="date_after" Type="String" /&gt;
          &lt;asp:ControlParameter DefaultValue="" ControlID="TopicDateBeforeFilterText" Name="date_before" Type="String" /&gt;
      &lt;/SelectParameters&gt;
  &lt;/asp:ObjectDataSource&gt;
  </code></pre>
  
  <p>And here is the body of the custom control:</p>
  
  <pre><code>&lt;asp:Panel id="TopicFilter_Panel" runat="server" CssClass="PopUp" ClientIDMode="Static" EnableTheming="False" EnableViewState="False" ViewStateMode="Disabled"&gt;
      &lt;asp:Panel runat="server" CssClass="PopUp_Heading"&gt;
          &lt;h1&gt;&lt;a id="TopicFilter_Close" href="#"&gt;Close [X]&lt;/a&gt;&lt;/h1&gt;
      &lt;/asp:Panel&gt;
      &lt;asp:Panel runat="server" CssClass="PopUp_Body"&gt;
          &lt;asp:Table runat="server"&gt;
              &lt;asp:TableRow runat="server"&gt;
                  &lt;asp:TableCell runat="server" HorizontalAlign="Right"&gt;
                      By Category:
                  &lt;/asp:TableCell&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:DropDownList
                          ID="TopicCategoryFilterList"
                          runat="server"
                          DataSourceID="TopicCategoryDataSource"
                          DataTextField="value"
                          DataValueField="value"
                          AppendDataBoundItems="True"
                          AutoPostBack="False"&gt;
                          &lt;asp:ListItem Selected="True" Value=""&gt;&amp;mdash; All &amp;mdash;&lt;/asp:ListItem&gt;
                      &lt;/asp:DropDownList&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
              &lt;asp:TableRow runat="server"&gt;
                  &lt;asp:TableCell runat="server" HorizontalAlign="Right"&gt;
                      By Author:
                  &lt;/asp:TableCell&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:DropDownList
                          ID="TopicCreatorFilterList"
                          runat="server"
                          DataSourceID="UserDataSource"
                          DataTextField="person_name_full"
                          DataValueField="user_id"
                          AppendDataBoundItems="True"
                          AutoPostBack="False"&gt;
                          &lt;asp:ListItem Selected="True" Value=""&gt;&amp;mdash; All &amp;mdash;&lt;/asp:ListItem&gt;
                      &lt;/asp:DropDownList&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
              &lt;asp:TableRow runat="server"&gt;
                  &lt;asp:TableCell runat="server" HorizontalAlign="Right"&gt;
                      By Date (After):
                  &lt;/asp:TableCell&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:TextBox ID="TopicDateAfterFilterText" runat="server" /&gt;
                      &lt;ajaxToolkit:CalendarExtender ID="TopicDateAfterCalendarExtender" TargetControlID="TopicDateAfterFilterText" PopupPosition="BottomRight" runat="server" /&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
              &lt;asp:TableRow runat="server"&gt;
                  &lt;asp:TableCell runat="server" HorizontalAlign="Right"&gt;
                      By Date (Before):
                  &lt;/asp:TableCell&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:TextBox ID="TopicDateBeforeFilterText" runat="server" /&gt;
                      &lt;ajaxToolkit:CalendarExtender ID="TopicDateBeforeCalendarExtender" TargetControlID="TopicDateBeforeFilterText" PopupPosition="BottomRight" runat="server" /&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
              &lt;asp:TableRow&gt;
                  &lt;asp:TableCell ColumnSpan="2" VerticalAlign="Bottom" HorizontalAlign="Center"&gt;
                      &lt;asp:Button runat="server" Text="Apply" CssClass="PopUp_Apply" /&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
          &lt;/asp:Table&gt;
      &lt;/asp:Panel&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>The error I'm getting is simply that the object datasource isn't seeing the controls inside my custom control (e.g., "Could not find control 'TopicCategoryFilterList' in ControlParameter 'category'"). Obviously a very simple matter, but I can't for the life of me seem to simply figure-out how to make this work. I'm quite certain this must've been addressed here, but I cannot find an example.</p>