title: MVC Return Partial View as JSON
body: <p>Is there a way to return an HTML string from rendering a partial as part of a JSON response from MVC?</p>
  
  <pre><code>    public ActionResult ReturnSpecialJsonIfInvalid(AwesomenessModel model)
      {
          if (ModelState.IsValid)
          {
              if(Request.IsAjaxRequest()
                  return PartialView("NotEvil", model);
              return View(model)
          }
          if(Request.IsAjaxRequest())
          {
              return Json(new { error=true, message = PartialView("Evil",model)});
          }
          return View(model);
      }
  </code></pre>