title: Persisting GridView data across PostBacks?
body: <p>Alright, so here's my basic ASP.NET page setup: I've got a page with a GridView that has ContentTemplates in it. You can add a row and edit/remove rows at any time. There's a "New" button that creates a new row.</p>
  
  <p>All of this data is bound to custom data objects. So if I have a GridView of "People" and each row has "FirstName", "LastName", and "Gender" (with TextBox and DropDown controls), I then have a "Person" object which has public properties for "FirstName", "LastName", etc. I have the binding set up correctly, and I can push data into the GridView from the object, and I persist the object with the Session variable. My page lifetime structure looks something like this:</p>
  
  <ul>
  <li><code>Page_Load</code>: Loads the <code>List(Of Person)</code> from <code>Session()</code></li>
  <li>Any events fire, and modify the <code>List(Of Person)</code>.</li>
  <li>After any event, the <code>List(Of Person)</code> gets saved back into <code>Session()</code>, and is then DataBound to the GridView (and any subsequent fields are also DataBound, such as the DropDownList.</li>
  </ul>
  
  <p>My question is: Whenever I fill in rows in the GridView, and then add a new row (there is no database saving going on whatsoever), my fields clear out and don't persist across PostBacks. So, how can I persist my custom data objects with databinding across postbacks?</p>