Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "CategoryID,Category")] CategoryList categoryList)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categoryList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categoryList));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "TopicID,Topic1,Tags,CategoryID,UserId,TimeStamp,TopicURL,Search")] Topic topic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(topic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.CategoryLists, "CategoryID", "Category", topic.CategoryID);
     return(View(topic));
 }