public ActionResult OnGetAjax(int studentId, bool official, string esig, string type) { try { Student s = Student.GetStudent(studentId); Transcript t = new Transcript(s, official, esig, type, DateTime.Now); string path = t.GenerateTranscript(); path = path.Replace("./Reports/", ""); path = path.Replace(".pdf", ""); return(new JsonResult(path)); } catch (Exception ex) { return(new JsonResult(ex.Message)); } }