public ActionResult OnPost() { try { if (ModelState.IsValid == false) { return Page(); } string cs = _config.GetConnectionString("Default"); int FilmID = fd.AddFilm(cs, NewFilm); return RedirectToPage("./View", new { Id = FilmID }); } catch (Exception ex) { throw new Exception(ex.ToString()); } }