public ActionResult Create(Link link) { if (ModelState.IsValid) { db.Links.Add(link); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.TabID = new SelectList(db.Tabs, "TabID", "Name", link.TabID); return View(link); }
public ActionResult Edit(Link link) { if (ModelState.IsValid) { db.Entry(link).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.TabID = new SelectList(db.Tabs, "TabID", "Name", link.TabID); return View(link); }