The same code will work in any page. Assuming you're model has the image then take the code that is working on your index page and paste it into the details page.
Note that the code you're showing on the details page is auto-generated but you don't have to use it. In this case since you just want to show it replace the contents of the <dt>
with just the img
tag that you're using on the index page. DisplayNameFor
and DisplayFor
don't make sense for an image. Since this structure is in a table you'll likely want the dt
to be either blank or just something simple like Image
and the dd
to be the actual image.
<dt class = "col-sm-2">
<label for="Imagesol">Image</label>
</dt>
<dd class = "col-sm-10">
<img src="@Image2" alt="" class="img-fluid">
</dd>