public ActionResult GetDrives(string path = "") { List <FolderTreeViewModel> drives; try { drives = driveService.GetDrives().Select(d => d.ToFolderTreeViewModel()).ToList(); } catch (UnauthorizedAccessException e) { return(Json(new { Status = "NotAcceptable" }, JsonRequestBehavior.AllowGet)); } if (Request.IsAjaxRequest()) { return(PartialView("GetDrivesTree", drives)); } return(View(drives)); }