public ActionResult Search(string productName) { IList <Product> products = ProductAPIController.GetProductByName(productName); ViewBag.ProductList = products; ViewBag.Size = products.Count; return(View()); }
public ActionResult Result() { string key = Request.QueryString["txtName"]; if (key!= null) { ViewBag.ProductList = ProductAPIController.GetProductByName(key); ViewBag.Size = ViewBag.ProductList.Count; } return View();