Failing to display an image in gridview. No error messages, just displays the image icon instead of actual image from database
I have a gridview, and I am using RowDataBound event to displays information in labels. I have an Image control in the gridview
<asp:TemplateField HeaderText="Picture">
<ItemTemplate>
<asp:Image ID="imgPicture" runat="server" />
</ItemTemplate>
</asp:TemplateField>
The image path is stored in database under a column called Image like Images\image.jpg
It's stored in a folder called Images in the solution
RowDataBound
Image imgPicture = (Image)e.Row.FindControl("imgPicture");
if ((imgPicture != null))
{
imgPicture.ImageUrl = @"~\Images\" + (string)DataBinder.Eval(e.Row.DataItem, "Image");
}