title: Entity DataSource control in a DynamicData app referencing an MVC CodeFirst project
body: <p>I added a Dynamic Data web app as a second project to an MVC 3 app. The Dynamic Data app references the derived EF 4.1 Context in the MVC 3 app (code first).</p>
  
  <pre><code>DefaultModel.RegisterContext(
      new EFCodeFirstDataModelProvider(() =&gt; new MvcApplication1.Models.Context()),
      new ContextConfiguration() { ScaffoldAllTables = true });
  </code></pre>
  
  <p>I want to try out a Dynamic GridView control but I don't understand how to configure the DataSource control. The connection string from my MVC app didn't work for the control. Nothing shows up in the control's configuration wizard even after a build. I am totally webforms/datasource illiterate. Am I way off here? How do I do this?</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.DynamicData.CustomPages.WebUserControl1" %&gt;
  
  &lt;asp:GridView ID="GridView1" runat="server"&gt;
  &lt;/asp:GridView&gt;
  
  &lt;asp:DynamicDataManager ID="DynamicDataManager1" runat="server" /&gt;
      &lt;DataControlReference ControlID="GridView1"/&gt;
  &lt;/asp:DynamicDataManager&gt;
  
  &lt;asp:EntityDataSource ID="EntityDataSource1" runat="server"&gt;
  &lt;/asp:EntityDataSource&gt;
  </code></pre>