I am trying to display image from database in repeater control inside my webform but image is not displaying.
I have my database table columns as this:
Id(int), Username(vachar 50), Subject(varchar MAX), Comment(varchar MAX), PostedDate(datetime), imgpost(varBinary MAX)
Here is my HTML and code
HTML
<asp:Repeater ID="RepDetails" runat="server" OnItemDataBound="OnItemDataBound">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div class="card shadow p-3 mb5 bg-white rounded" style="border: 1px solid #d1d5d4; margin: 15px; padding: 0px 0px; width: auto; border-radius: 10px;">
<asp:Table runat="server">
<asp:TableRow>
<asp:TableCell>
<span class="time">
<asp:Label ID="lblUser" runat="server" ForeColor="#008000" Font-Size="11pt" Text='<%#Eval("Username") %>' />
<i class="fa fa-clock-o" aria-hidden="true" style="font-size: 10pt; font-weight: 100; color: #838996;"></i>
<asp:Label ID="lblDate" runat="server" ForeColor="#666666" Font-Size="7.5pt" Text='<%# Eval("PostedDate", "{0:MMMM d yyyy}") %>' />
<asp:Label runat="server" ForeColor="#666666" Font-Size="8pt" Text="at"></asp:Label>
<asp:Label ID="Datelabel" runat="server" ForeColor="#666666" Font-Size="7.5pt" Text='<%# Eval("PostedDate", "{0:hh:mm tt}") %>' /></span>
<hr />
<br />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblComment" runat="server" Font-Size="9.5pt" Text='<%#Eval("Comment") %>' /><br />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Image ID="postimg" runat="server" ImageUrl='<%# Eval("imgpost") %>' height="60" width="80" />
<hr />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<span>
<asp:Label runat="server" Font-Size="8pt" Text="Comment"></asp:Label>
<asp:HyperLink ID="HyperLink1" runat="server" Font-Names="Nunito" ForeColor="#006699" Text="Comment2" Font-Size="8pt"></asp:HyperLink>
</span>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<br />
</div>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>