title: Strongly Typed Model Binding in multiple Web User Controls on a single Formview
body: <p>I'm trying to use the ASP.NET 4.5 strongly typed model binding on multiple web user controls that are added to a single Formview inside the Edit and Item Templates so I can update the data.  </p>
  
  <p>i.e. I have an aspx page like this-ish</p>
  
  <pre><code>&lt;asp:FormView ID="FormView1" runat="server" 
          ItemType="MyDataLayer.MyDataItem" 
          SelectMethod="FormView1_GetItem" 
          UpdateMethod="FormView1_UpdateItem" 
          DataKeyNames="MyDataItemID" &gt;
  
          &lt;EditItemTemplate&gt;
              &lt;asp:LinkButton Text="Update" runat="server" CommandName="Update"/&gt;
              &lt;uc1:WebUserControl1 runat="server" id="WebUserControl1" /&gt;
              &lt;uc1:WebUserControl1 runat="server" id="WebUserControl2" /&gt;
          &lt;/EditItemTemplate&gt;
  
          &lt;ItemTemplate&gt;
              &lt;asp:LinkButton Text="Edit" runat="server" CommandName="Edit" /&gt;
              &lt;uc1:WebUserControl1 runat="server" id="WebUserControl1" /&gt;
              &lt;uc1:WebUserControl1 runat="server" id="WebUserControl2" /&gt;
          &lt;/ItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>With ascx user controls like this(simplified version)</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="false" 
      CodeBehind="WebUserControl1.ascx.cs" 
      Inherits="WebApplicationTests.WebUserControl1" %&gt;
  
  &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# BindItem.Name%&gt;'&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>I'm able to get it to work if I move the guts of the user control to the page with the formview, but it will not work in the user control.</p>
  
  <p>In other words, I want the user control fields bound to the parent page Formview data with the new "BindItem", and use the formview ItemType, so I will have a single item of data, bound to multiple controls that hold different pieces of the same item within the formview.
  (The project is based on a monolithic table with everything, but we want to separate the data to the user for clarity)   </p>
  
  <p>If there are any idea's on how to get this to work, or anyone knows why it doesn't work that would be great!</p>