public ActionResult Edit(string id) { if(!Request.IsAuthenticated) { return RedirectToAction("Index"); } ProductModel product = new ProductModel(); ViewBag.Product = product.GetProductByName(id); return View(); }
public ActionResult Product(string id) { ProductModel model = new ProductModel(); ViewBag.Product = model.GetProductByName(id); if (ViewBag.Product == null) { return RedirectToAction("Index", "Home"); } return View(); }