public ActionResult OrderDetails(string orderid, string restcode) { if (orderid != null) { if (restcode == null | restcode == "") { restcode = "HN"; } Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.orderdetails(orderid, restcode); //foreach (var item in modelCust) //{ // string Price = item.Price; // string Quantity = item.Quantity; // string ProductName = item.ProductName; //} ViewBag.check = "Y"; ViewBag.data = modelCust.ToList(); return(PartialView("OrderDetails")); } ViewBag.check = "N"; return(PartialView("OrderDetails", null)); }