7.1: Validation Messages
Update the Create [HttpPost] Method
[HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(NoteCreate model) { if (!ModelState.IsValid) return View(model); var service = CreateNoteService(); if (service.CreateNote(model)) { return RedirectToAction("Index"); }; return View(model); }
ViewBag vs ValidationSummary
Add Model Error Message
Add Success Message
Add a Bootstrap Error Message in the View
Last updated

