title: TempData not passing object
body: <p>I have this method:</p>
  
  <pre><code>[HttpPost]
  public  async Task&lt;ActionResult&gt; AddBookingCreditCard(TripViewModel model)
  {
      if (ModelState.IsValid)
      {
          // do nothing right now
      }
  
      TempData["ccInfo"] = model.CcInfo;
      return RedirectToAction("Book", new{ id = model.Trip.TripId, travellers = model.Travellers});
  }
  </code></pre>
  
  <p>In this case, model.CcInfo DOES exist and contains an object of type CcInfo. After the RedirectToAction, this method is called:</p>
  
  <pre><code>[HttpGet]
  public async Task&lt;ActionResult&gt; Book(int id, int travellers)
  {
      var vm = new TripViewModel();
      vm.Travellers = travellers;
  
      if (TempData["ccInfo"] != null)
          vm.CcInfo = TempData["ccInfo"] as CcInfo;
  
      // lot of code
  
      return View("Index", vm);
  }
  </code></pre>
  
  <p>The if-statement always fails: TempDate["ccInfo"] is null, while it should contain my object.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>EDIT:
  The CcInfo class:</p>
  
  <pre><code>public class CcInfo
  {
      [Display(Name = "Name on Card"), Required]
      public string CcName { get; set; }
  
      [Display(Name = "Card Number"), DataType(DataType.CreditCard), Required]
      public int CcNumber { get; set; }
  
      [Display(Name = "Card CVV"), Required, Range(100, 999)]
      public int CcCheck { get; set; }
  }
  </code></pre>