TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Uvie Jakpor
NA
15
834
how to save and update a record using the same view
Dec 16 2014 1:41 AM
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();
Reply
Answers (
0
)
asp.net Gridview not Binding
mvc4 with entity framework tutorial for beginners