I have an Image object in ASP.NET I am assigning an ImageUrl to it but I'm noticing that it does not display a thing when it's a format different from PNG.
In this case, I need it to accept JPG. What can be done?
<table>
<tr>
<td>
<strong>
Foto
</strong>
<br/>
<asp:Image ID="Image1" runat="server" ToolTip="Foto" Width="320px" Height="240px" ImageUrl='<%# "C:/Images/pictures/" + Eval("picture") %>' />
</td>
<td />
<td>
<strong>
Firma
</strong>
<br/>
<asp:Image ID="imgSignature" runat="server" ToolTip="Firma" Width="320px" Height="240px" ImageUrl='<%# "C:/Images/signatures/" + Eval("signature") %>' />
</td>
</tr>
</table>
picture = 1.jpg
signarute = 2.png
the first one is not working, the second one does. This is inside a gridview row.
You can't use physical file paths for images. You either need to use the absolute path, or more simply, the relative path, like
~/Images/signatures/myImage.jpg
:Side note, you shouldn't use tables for layout / formatting. Use CSS.