Pooja Chowdhury

Pooja Chowdhury

  • NA
  • 396
  • 39.3k

modelstats.isvalid

Feb 3 2017 3:29 AM
[HttpPost] public ActionResult Create(Users user) { if (ModelState.IsValid) {         db.Users.Add(user);         db.SaveChanges(); return RedirectToAction("Index"); } return View(user); }

ModelState.IsValid is always false.
so it just return view and new record is not getting added..


Answers (9)