The easiest way is to pass it to the Model that you pass to the Details view.
public ActionResult Details(int id) { var item =
in your opinion, you can do something like:
<ul> <%: if (Model.Images != null) foreach(var item in Model.Images) { %> <li> <%: item.Name %> </li> <% } %> </ul>
You can also just pass the list through ViewData, but I think that passing it in your model is more accurate, since it does not require setting any other variable, EF does this for you in the model.
Note. Some of the names I entered may be disabled, but Intellisense will provide you with the correct names, since EF has already generated these objects. Hope you understand the basic idea that I am trying to explain :-)
source share