title: The DataSourceID of 'DataListCity' must be the ID of a control of type IDataSource. A control with ID 'SqlDataSource1' could not be found
body: <p>I get this error on the page when I try to display the page in browser</p>
  
  <p>The <code>DataSourceID</code> of <code>DataListCity</code> must be the ID of a control of type <code>IDataSource</code>.  </p>
  
  <p>And get this error.</p>
  
  <blockquote>
    <p>A control with ID SqlDataSource1 could not be found.</p>
    
    <p>Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.</p>
    
    <p>Exception Details: System.Web.HttpException: The DataSourceID of
    'DataListCity' must be the ID of a control of type IDataSource.  A
    control with ID 'SqlDataSource1' could not be found.</p>
  </blockquote>
  
  <p>Here is the code in my Masterpage that is causing the error :</p>
  
  <pre><code>&lt;asp:DataList ID="DataListCity" runat="server" Width="100%"                 
  onitemcommand="DataListCity_ItemCommand"                                    
  DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333"&gt;
  &lt;ItemTemplate&gt;
  CityId:                                                                              
  &lt;asp:Label ID="CityIdLabel" runat="server" Text='&lt;%# Eval("CityId") %&gt;' /&gt;                                                             
  &lt;br /&gt;
  CityName:                                                                     
  &lt;asp:Label ID="CityNameLabel" runat="server" Text='&lt;%# Eval("CityName") %&gt;' /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt; 
  </code></pre>