title: datasources and Eval in a gridview
body: <p>I have a gridview using a linqdatasource with a datamodelcontext that I've created.</p>
  
  <p>Why is it that I can do this:</p>
  
  <pre><code>&lt;asp:TemplateField&gt;
      &lt;ItemTemplate&gt;
         &lt;asp:Label ID="Label3" runat="server" Text='&lt;%# Eval("tblUserProfile.Phone") %&gt;'&gt;
         &lt;/asp:Label&gt;
       &lt;/ItemTemplate&gt;
   &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>But this:</p>
  
  <pre><code>&lt;asp:BoundField DataField="tblUserProfile.Phone" HeaderText="ph" ReadOnly="True"/&gt;    
  </code></pre>
  
  <p>Gives an error:</p>
  
  <p>"A field or property with the name 'tblUserProfiles.Phone' was not found on the selected data source."</p>
  
  <p>If the field or property doesn't exist on the datasource, how does it work in the first case? What does the eval do exactly? I thought it just let you access a field on the datasource?</p>
  
  <p>Pretty new to this, so if someone could give me a basic explanation I'd appreciate it.</p>
  
  <p>For an extra cookie, any ideas why this would let me edit this field, but when I click update on the gridview it wouldn't actually save it?</p>
  
  <pre><code>  &lt;asp:TemplateField&gt;
       &lt;ItemTemplate&gt;
          &lt;asp:Label ID="Label3" runat="server" Text='&lt;%# Eval("tblUserProfile.Phone") %&gt;'&gt;
          &lt;/asp:Label&gt;
       &lt;/ItemTemplate&gt;
       &lt;EditItemTemplate&gt;
          &lt;asp:TextBox ID="tb1" runat="server" Text='&lt;%#Bind("tblUserProfile.Phone") %&gt;'&gt;&lt;/asp:TextBox&gt;
        &lt;/EditItemTemplate&gt;
     &lt;/asp:TemplateField&gt;
  </code></pre>