C# Asp.NETMVC在网页中显示图像?
当用户注册时,我从我存储的数据库中检索了9个映像路径。。。。在一个页面中,我必须在每行显示3个图像…如何做到这一点 我创建了具有可变映像路径和用户id的模型类“FriendsList”C# Asp.NETMVC在网页中显示图像?,c#,asp.net-mvc,C#,Asp.net Mvc,当用户注册时,我从我存储的数据库中检索了9个映像路径。。。。在一个页面中,我必须在每行显示3个图像…如何做到这一点 我创建了具有可变映像路径和用户id的模型类“FriendsList” public String FriendImagePath { get; set; } public int FriendUserId { get; set; } 我创建了视图模型类并创建了模型类类型的变量“FriendsList” public List<Friends
public String FriendImagePath
{
get;
set;
}
public int FriendUserId
{
get;
set;
}
我创建了视图模型类并创建了模型类类型的变量“FriendsList”
public List<FriendsList> FriendsList { get; set; }
publicslist-FriendsList{get;set;}
我在这个数据库中存储了9个值
在.Aspx页面中,我必须显示3行。。在每一行我必须显示3个图像
怎么做
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
如何做到这一点
谢谢..
<table>
<tr>
<%
int index=0;
foreach(var friend in Model){ %>
<% if(index%3==0){ %>
</tr><tr>
<% } %>
<td><img src="<%=Url.Content(friend.FriendImagePath) %>" /></td>
//others prpoerties
<%
index++;
} %>
</tr>
</table>
" />
//其他财产