hello guys,am working on an online admission system where i store records of students in my database.
i have a form where i want to implement a save and update record in the same view insteasd of passing the values to another view for update..here is my code below
if (ModelState.IsValid)
{
student = db.Students.Find(student.ID);
if (student == null)
{
db.Students.Add(student);
}
else
{
db.Entry(student).State = EntityState.Modified;
}
db.SaveChanges();