title: Where to store temporary data in an ASP.NET application
body: <p>In my web application I have a number of custom grids on a page. I want the user to be able to edit data in each grid and then press save once at the end of the process to commit their changes.</p>
  
  <p>So I need somewhere temporary to persist their changes before they are comitted. The grids will use AJAX/Javascript so as to not force a full page refresh when data is edited</p>
  
  <p>I can think of the following options for storing temporary data</p>
  
  <ol>
  <li>Hidden form fields</li>
  <li>ViewState</li>
  <li>Session </li>
  </ol>
  
  <p>The option I'm least comfortable with is the ViewState option as I have read that this is being phased out in ASP.NET 4.0 and am not sure if you can access ViewState from an AJAX page method. </p>
  
  <p>I'm interested in peoples opinions on the above options and also if ViewState should be used for storing data that is not related to out of the box controls.</p>