public ActionResult ApplicationDetails(int id) { IEnumerable <application> appList = applicationDAO.getApplication(id); List <application> appQuery = new List <application>(); appQuery.AddRange(appList); //application app = new application(); int vc_id = 0; foreach (var i in appQuery) { vc_id = (int)i.vc_id; } IEnumerable <cards> cardQuery = applicationDAO.getCardById(vc_id); List <cards> cardList = new List <cards>(); cardList.AddRange(cardQuery); string path = null; foreach (var i in cardList) { path = i.IMAGES.Image; } //path = path.Replace(@"\", "/"); ViewBag.ImageData = path; return(PartialView("ApplicationDetails")); }