0
,所以我有我的数据库中的图像,我想向他们展示在我看来,这是我的模型:如何从数据库显示图像到剃刀视图?
public class SocialNetworkModel
{
[Required]
[DataType(DataType.Text)]
public string titlePost { get; set; }
[Required]
[DataType(DataType.Text)]
public string descriptionPost { get; set; }
public byte[] picturePost { get; set; }
}
这是我的看法:
foreach (var item in Model) {
<tr id="[email protected]">
<td>
@Html.DisplayFor(modelItem => item.titlePost)
</td>
<td>
@Html.DisplayFor(modelItem => item.descriptionPost)
</td>
<td>
//here i want to put my image
</td>
</tr>
}
所以请有人有任何想法,我会非常感激。
检查此问题http://stackoverflow.com/questions/9149430/displaying-image-from-db-in-razor-mvc3 – 2013-05-05 15:05:07
感谢兄弟对我有用 – Mohammadov 2013-05-05 15:35:58