public IActionResult OnPost(IFormFile fileEpisode) { if (!ModelState.IsValid) { return(Page()); } if (fileEpisode != null) { if (_courseSerervice.ChecExistFile(fileEpisode.FileName)) { ViewData["IsExistfile"] = true; return(Page()); } } _courseSerervice.EditEpisode(CourseEpisode, fileEpisode); return(Redirect("/Admin/Courses/IndexEpisode/" + CourseEpisode.CourseId)); }