Wie erstellt man einen dynamischen src innerhalb einer foreach-Schleife?
<%foreach (Art a in SearchedArt)%>
\t \t \t <%{ %>
\t \t \t \t <tr>
\t \t \t \t \t <td><asp:Image ID="Image1" runat="server" src=<%a.PicturePath %>/></td>
\t \t \t \t \t <td><%= Global.Users.Find(m => m.UserID == a.UserID).Name %></td>
\t \t \t \t \t <td>
\t \t \t \t \t \t <ul>
\t \t \t \t \t \t \t <%foreach (string tag in a.Tags) %>
\t \t \t \t \t \t \t <%{ %>
\t \t \t \t \t \t \t \t <li><%= tag %></li>
\t \t \t \t \t \t \t <%} %>
\t \t \t \t \t \t </ul>
\t \t \t \t \t </td>
\t \t \t \t </tr>
\t \t \t <%} %>
Also, was ich versuche, für jedes Stück Kunst in einer Tabelle ein anderes Bild zu tun ist, angezeigt werden soll. Src = <% a.PicturePath%> scheint jedoch nicht den Trick zu machen (Ich habe es mit Zitaten probiert und es hat auch nicht funktioniert). Wie mache ich das?
Bist du nicht ein Gleichheitszeichen fehlt Innerhalb? src = "<% = a.PicturePath%>" –
Oh ja mein Original hatte das "=" – Xigaphactus