[HttpPost]
public ActionResult Create(Users user)
{ ModelState.Remove(“Password”); //加上这句就行了 if (ModelState.IsValid)
{
user.Password="admin";
db.Users.Add(user);
db.SaveChanges();
return View("Index");
}
return View();
}
2024-03-15 08:09:23
[HttpPost]
public ActionResult Create(Users user)
{ ModelState.Remove(“Password”); //加上这句就行了 if (ModelState.IsValid)
{
user.Password="admin";
db.Users.Add(user);
db.SaveChanges();
return View("Index");
}
return View();
}
下一篇:oracle执行计划(转载)