public JsonResult State(int id) { var asset = _assetManager.GetAssetById(id); return(Json(new { uploadState = new { status = asset.UploadState.Status.ToString(), percentComplete = (int?)asset.UploadState.PercentComplete, }, published = asset.VideoPart != null && asset.VideoPart.IsPublished() // VideoPart can potentially be null here if the user deleted the media item, and an AJAX request was still issued. }, JsonRequestBehavior.AllowGet)); }