public ActionResult Edit([Bind(Include = "Id,BigSlogan,SmallSlogan,LanguageId")] Slogans slogans) { if (ModelState.IsValid) { db.Entry(slogans).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LanguageId = new SelectList(db.Language, "Id", "Name", slogans.LanguageId); return(View(slogans)); }
// GET: Control/Slogans/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Slogans slogans = db.Slogans.Find(id); if (slogans == null) { return(HttpNotFound()); } ViewBag.LanguageId = new SelectList(db.Language, "Id", "Name", slogans.LanguageId); return(View(slogans)); }