/ / Collega le immagini in vista del rasoio a <img src> che sono in loop - asp.net, asp.net-mvc, rasoio

Collega le immagini in vista del rasoio a <img src> che sono in loop - asp.net, asp.net-mvc, rasoio

In questo momento l'unica cosa che voglio sapere è comeassociare l'immagine a "img src" nella vista del rasoio. Ho cercato le altre domande ma non ho trovato la risposta per le immagini in loop. Il modo corrente scritto non funziona. "~ / Images /" è la cartella in cui le immagini caricate sono.

@model List<propertyMgmt.Models.Property>
<div id="propertyList">
<label>Select properties to be Featured:</label><br />
<table class="table">
<tr>
<th>
@Html.Label("Property Description")
</th>
<th>
@Html.Label("Property Cost")
</th>
<th>
@Html.Label("Property Image")
</th>
<th>
@Html.Label("Featured??")
</th>
</tr>
@for (int i=0;i<Model.Count;i++)
{
<tr>
<td>
@Html.DisplayFor(m => m[i].PropertyDescription)
</td>
<td>
@Html.DisplayFor(m => m[i].PropertyCost)
</td>
<td>
<img src="/images/~/Images/@(m=>m[i].PropertyImage)" />
</td>
<td>
@Html.CheckBoxFor(m => m[i].IsFeatured, new {
@onclick = "propertyCheckBoxSelect(this)" })
</td>
</tr>
}
</table>
</div>

risposte:

0 per risposta № 1

Puoi usare così.

<img src="/images/~/Images/@(Model[i].PropertyImage)" />