{Html.RenderAction("Create", Model);}
[HttpGet] public ActionResult Create() { return PartialView("_CreateCategory",new Inventory.Models.Category()); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include="Id,Description")] Category category) { if (ModelState.IsValid) { db.Categories.Add(category); db.SaveChanges(); return RedirectToAction( "Index"); } return PartialView(category); }
public ActionResult Index() { return View(db.Categories.ToList()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)