title: Casting collection of objects from TempData (MVC C#)
body: <p>I am trying to put my collection of objects into TempData like this:</p>
  
  <pre><code>  [HttpPost]
    public ActionResult PandoraRemovalTotal2(List&lt;Business.Models.Administration.CorrespondenceRecordViewModel&gt; model, string hdnMem)
      {
          Business.Administration.Pandora Pandora = new Business.Administration.Pandora();
          model = Pandora.DeleteDocs(model);
          TempData["model"] = model.Where(m =&gt; m.DeleteRow == true);
          return RedirectToAction("PandoraDocsDeleted", new {memNum = hdnMem });
      }
  </code></pre>
  
  <p><strong>And pass it through redirect to action</strong></p>
  
  <pre><code>[HttpGet]
  public ActionResult PandoraDocsDeleted(string memNum)
  {
      var model = (List&lt;Business.Models.Administration.CorrespondenceRecordViewModel&gt;)TempData["model"];
      ViewBag.MemNum = memNum;
      return View(model);
   }
  </code></pre>
  
  <p>But when I do this:</p>
  
  <pre><code>var model = (List&lt;Business.Models.Administration.CorrespondenceRecordViewModel&gt;)TempData["model"];
  </code></pre>
  
  <p>it is null. How do I cast this?</p>