title: ASP.NET MVC RedirectToAction doesn't work after AJAX Post from view
body: <p>I'm trying to reload my view from the controller, in order to display data stored in TempData after an AJAX POST call to my controller.
  The problem is that my call to the method RedirectToAction doesn't redirect anything.</p>
  
  <p>Here's some code samples</p>
  
  <p>View:</p>
  
  <pre><code>    $('#incidentTableBody').on('click', 'button.relayBack', function () {
              Post('/Incident/RelayBack', { incidentId: $(this).parent().parent().data('id'), ownerId: $(this).parent().parent().data('ownerid') }, function () {  });
          });
  
      function Post(action, data, callback) {
              $.ajax({
                  url: action,
                  type: "POST",
                  data: data,
                  //error: function (jqXHR, textStatus, errorThrown) {
                  //    console.log(errorThrown);
                  //},
                  success: callback,
                  cache: false
              });
          }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    [Authorize]
      public ActionResult IncidentList()
      {
          ViewBag.Title = "IncidentList";
          return View();
      }
  
      [HttpPost]
      [Authorize]
      public ActionResult RelayBack(string incidentId, string ownerId)
      {
          bool success;
          try
          {
              new Guid(_incidentService.RelayBack(new Guid(incidentId), new Guid(ownerId)));
              success = true;
          }
          catch
          {
              success = false;
          }
  
          if (success)
          {
              TempData["Message"] = "Le ticket a bien été relancé par l'équipe support";
              TempData["Class"] = "alert-success";
          }
          else
          {
              TempData["Message"] = "Une erreur est survenue lors de la relance de l'incident";
              TempData["Class"] = "alert-warning";
          }
  
          return RedirectToAction("IncidentList"); // TODO : redirect doesn't work
      }
  </code></pre>
  
  <p>My AJAX call works and calls my controller, then all my controller method instructions but the last one (redirection) run correctly. The last one, RedirectToAction, actually calls IncidentList() that's supposed to return my view but nothing happens. </p>
  
  <p>I tried to replace RedirectToAction with View, Redirect... nothing better happened. I tried to reload from my AJAX success callback function, but the behaviour wasn't what I expected, and I prefer to do it from my Controller. </p>
  
  <p>I have already done the same (a RedirectToAction call to reload my page and display TempData stored data) in my app, but after a form POST submission and not an AJAX call, could it (AJAX) be the source of the problem?</p>