Asp.net mvc - trying to display images pulled from db \
Posted
by Trey Carroll
on Stack Overflow
See other posts from Stack Overflow
or by Trey Carroll
Published on 2010-03-24T21:40:09Z
Indexed on
2010/03/24
21:53 UTC
Read the original article
Hit count: 361
//Inherits="System.Web.Mvc.ViewPage<FilmFestWeb.Models.ListVideosViewModel>"
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>ListVideos</h2>
<% foreach(BusinessObjects.Video vid in Model.VideoList){%>
<div class="videoBox">
<%= Html.Encode(vid.Name) %>
<img src="<%= vid.ThumbnailImage %>" />
</div>
<%} %>
</asp:Content>
//ListVideosViewModel
public class ListVideosViewModel
{
public IList<Video> VideoList { get; set; }
}
//Video
public class Video
{
public long VideoId { get; set; }
public long TeamId { get; set; }
public string Name { get; set; }
public string Tags { get; set; }
public string TeamMembers { get; set; }
public string TranscriptFileName { get; set; }
public string VideoFileName { get; set; }
public int TotalNumRatings { get; set; }
public int CumulativeTotalScore { get; set; }
public string VideoUri { get; set; }
public Image ThumbnailImage { get; set; }
}
I am getting the "red x" that I usually associate with image file not found. I have verified that my database table shows after the stored proc that uploads the image executes. Any insight or advice would be greatly appreciated.
© Stack Overflow or respective owner