// // GET: /Home/Create public ActionResult Create() { ViewData["myid"] = User.Identity.Name; RKSurvey model = new RKSurvey { name = User.Identity.Name }; return View(model); }
public ActionResult Create(RKSurvey rksurvey) { if (ModelState.IsValid) { db.rksurveylist.Add(rksurvey); db.SaveChanges(); return RedirectToAction("Index"); } return View(rksurvey); }
public ActionResult Edit(RKSurvey rksurvey) { if (ModelState.IsValid) { db.Entry(rksurvey).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(rksurvey); }