title: How to return a JsonResult or an ActionResult in the same method depending on input?
body: <p>I have a situation where i need return a JSONResult or a Redirect.
  Is it possible?</p>
  
  <p>Example:</p>
  
  <pre><code>public ActionResult Example(string code)
  {
    if(string.IsNullorEmpty(code))
      return RedirectToAction("Index", "Home");
    else
      return Json(new { success = true, message= "Next step"});
  }
  </code></pre>