I’m trying to query for a particular column & to show the item list in view properly one after another. Here is my code:
Controller:
public ActionResult ShowImage()
{
using (var context = new ImageTrialDBEntities())
{
var pathlist = (from s in context.Images
select s.ImageLink).ToList();
var model = new ImageModel();
model.ImageList = pathlist;
return View(model);
}
}
Model:
public class ImageModel
{
public string Image { get; set; }
public IList<string> ImageList { get; set; }
}
View:
<div>
@foreach (var s in Model.ImageList)
{
@Html.DisplayFor(x=>x.ImageList)
<br />
}
</div>
The list is showing like this:

I would like to show one at a time with a break in between. Please help.
Replace
with