public ActionResult Create(task task, List<prompt> prompts)
        {
            //validate
            if (ModelState.IsValid)
            {
                db.tasks.Add(task);
                db.SaveChanges();

                //return RedirectToAction("Index");//default code
                return Redirect("/Prompt/Index/" + task.taskID);
            }

            ViewBag.taskCategoryID = new SelectList(db.taskcategories, "categoryID", "categoryName", task.taskCategoryID);
            return View(task);
        }
 public ActionResult Edit(task task)
 {
     if (ModelState.IsValid)
     {
         db.Entry(task).State = EntityState.Modified;
         //db.Entry(task.prompts).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.taskCategoryID = new SelectList(db.taskcategories, "categoryID", "categoryName", task.taskCategoryID);
     return View(task);
 }