title: Problems with RedirectToAction MVC2 - Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult'
body: <p>I am receiving this error when trying to use RedirectToAction, can anyone offer any advice on why this could be occuring, ive used this before without any problems, i must be missing something.  </p>
  
  <p>Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult'</p>
  
  <pre><code> [HttpPost]
      public ViewResult Edit(Customer customer)
      {
          if (ModelState.IsValid)
          {
              customersRepository.SaveCustomer(customer);
              TempData["message"] = customer.CustomerName + " has been saved.";
              return RedirectToAction("Index");
          }
  
          else //validation error, so redisplay the same view
              return View(customer);
  
      }
  </code></pre>
  
  <p>Regards</p>
  
  <p>Liam</p>