title: databinding a Gridview in MVC
body: <p>I'm trying to teach myself MVC, and i'm having issues with the code behind.</p>
  
  <p>In my current issue, I'm trying to bind data to a gridview.  Now, I have been able to do it by creating page_load method in my aspx.</p>
  
  <pre><code>&lt;script language="CS" runat="server"&gt; 
  void Page_Load(object sender, System.EventArgs e)  
  {
    grdMyGrid.DataSource = Model.getAllRecords();
    grdMyGrid.DataBind();
  } 
  &lt;/script&gt;
  </code></pre>
  
  <p>This works, however, in my mind this can't be right.  I have been forcing myself for the last year to make sure all binding are happening in the code behind, and all the MVC samples I have found show doing a databind in the aspx! (though they are all limited to textboxes).  So what is the right method for doing this?</p>
  
  <p>Thanks</p>