public ActionResult Create() { ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName"); var model = new Bookmark(); return View(model); }
public ActionResult Create(Bookmark bookmark) { if (ModelState.IsValid) { bookmark.Description = Encoder.HtmlEncode(bookmark.Description); _repository.InsertOrUpdate(bookmark); return RedirectToAction("Index"); } ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName"); return View(bookmark); }
public ActionResult Edit(Bookmark bookmark) { if (ModelState.IsValid) { _repository.InsertOrUpdate(bookmark); return RedirectToAction("Index"); } ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName"); return View(bookmark); }