//List the contents of the database public ActionResult Show() { FORMDBContext context = new FORMDBContext(); List <Lists> all = context.Lists.ToList(); ViewBag.AllListItems = all; return(View()); }
public ActionResult Submit(string textBoxStringData) { FORMDBContext context = new FORMDBContext(); Lists newObject = new Lists() { ListData = textBoxStringData, ListTime = DateTime.Now }; context.Lists.Add(newObject); context.SaveChanges(); return(RedirectToAction("ConfirmationPage")); }