public ActionResult Input(string id = "") { if (string.IsNullOrEmpty(id)) { ViewBag.Title = " Create new Product"; Product newProduct = new Product() { ProductID = 0 }; return(View(newProduct)); } else { ViewBag.Title = "Edit a Product"; Product editProduct = CataLogBLL.GetProduct(Convert.ToInt32(id)); if (editProduct == null) { return(RedirectToAction("Index")); } return(View(editProduct)); } }