My MVC3 app uploads documents from the user to our server. I am returning a JsonResult to display any errors, if any:
[HttpPost] public JsonResult SaveDoc
The proper JsonResult return should look like so:
[HttpPost] public JsonResult SaveDocument(DocumentModel model, HttpPostedFileBase postedFile) { ... return Json(new { success = true, message="ok" }, "application/json; charset=utf-8", JsonRequestBehavior.AllowGet); }