// GET: Project/Edit/5 public ActionResult Edit(string id) { if (string.IsNullOrWhiteSpace(id)) { return(RedirectToAction("index")); } var p = bll.Find(id); if (p != null) { ProjectViewModel model = new ProjectViewModel { Id = p.Id, ProjectName = p.ProjectName }; return(View(model)); } return(RedirectToAction("index")); }