public ActionResult Index() { home_img home_img = new home_img(); home_text home_text = new home_text(); FirstModel model = new FirstModel(); model.home_img = db.home_img.ToList(); model.home_text = db2.home_text.ToList(); return(View("Index", model)); }
public ActionResult Editok2(home_text change) { int?id = change.id; if (id == null || id == 0) { return(View("Index")); } if (ModelState.IsValid) { db2.Entry(change).State = EntityState.Modified; db2.SaveChanges(); return(View("Index")); } return(View("Index")); }