title: Ajax call to a controller action result returns error message
body: <p>I am making an Ajax call to an ActionResult Method called Estatement.
  Here is what I want to happen</p>
  
  <ol>
  <li><p>if checkUser = false, there should be a redirection to a view</p></li>
  <li><p>If checkuser is not false I want to return a Done as success and have my ajax
  code do something.</p></li>
  </ol>
  
  <p>Right now I am unable to redirect to statement view and all I get is the alert from the error message (an error occured while trying to process this) </p>
  
  <p>What do you think is wrong with this code?</p>
  
  <pre><code>    &lt;div class="eStmnt"&gt;
          &lt;div class="eStmntAd"&gt;
              &lt;h3&gt;Go Green!&lt;/h3&gt;       
          &lt;/div&gt;
  
          &lt;p class="eStmntAffirm hide"&gt;Testing Testing&lt;/p&gt;
      &lt;/div&gt;
  
  
      &lt;script type="text/javascript"&gt;
          $(".eStmnt").click(function() {
  
              $.ajax({
                  type: "POST",
                  url: '@Url.Action("Estatement","MyController")',
                  dataType: "json",
                  success:function(result) {               
                      if (result == "Done") {
                          $(".eStmntAffirm").removeClass("hide").addClass("show");
                      }                   
                  },
                  error: function() {
                      alert('An error occured while trying to process this');
                  }
              });
  
          });
  
      &lt;/script&gt;
  
  
       public ActionResult  Estatement()
              {
  
                  bool checkUser = false;
                  string result = string.Empty;
  
                  if (checkUser == false)
                  {
                      return RedirectToAction("Statement","MyProducts");       
                  }
  
                  result = "Done";
  
                  return Json(result);
  
              }
  </code></pre>