title: How to persist the data in memory in MVC controller?
body: <p>Please look at the below action. When the user navigate the first time, creates a object, then while he navigates in the page, access again to the Action but through Ajax request and the data disappers (worksheets = null).</p>
  
  <pre><code>    private static List&lt;Worksheet&gt; worksheets;
      public ActionResult DoTest()
      {
          if (Request.IsAjaxRequest())
          {
              return PartialView("_Problems", worksheets[1]);
          }
  
          // first time
          worksheets = new List&lt;Worksheet&gt;()
          {
              new Worksheet("Hoja 1", ...),
              new Worksheet("Hoja 2", ...)
          };
          return View(worksheets[0]);
      }
  </code></pre>
  
  <p>My first solution was set the variable worksheets to static, but I supposed this is not a good practice. Am I doing a good way or are there another tweeks?</p>