I'm hoping there's a simple way to do this. I need to show a dummy image in
an asp image object if the file is missing. Here's my asp.net 2.0 markup:
<asp:Image ID="imgGrad" runat="server" BorderColor="Di mGray"
BorderStyle="So lid" BorderWidth="1p x" Height="120px" ImageUrl='<%#
"~/Images/ClassmatePics/" & Eval("GradPhoto FileName") %>' ToolTip="Click to
enlarge" /></td>
"GradPhotoFileN ame" is stored in a field in a table. If the file name stored
in the table is "JeffJones. jpg" but there is no "JeffJones. jpg" file in the
"~/Images/ClassmatePics/" folder then I have a dummy jpg image that I want
to show ("MissingPhoto. jpg").
I'm hoping there's an easy way to do that maybe in the EVAL code but I don't
know how. Can someone help me out?
Thanks,
Keith
an asp image object if the file is missing. Here's my asp.net 2.0 markup:
<asp:Image ID="imgGrad" runat="server" BorderColor="Di mGray"
BorderStyle="So lid" BorderWidth="1p x" Height="120px" ImageUrl='<%#
"~/Images/ClassmatePics/" & Eval("GradPhoto FileName") %>' ToolTip="Click to
enlarge" /></td>
"GradPhotoFileN ame" is stored in a field in a table. If the file name stored
in the table is "JeffJones. jpg" but there is no "JeffJones. jpg" file in the
"~/Images/ClassmatePics/" folder then I have a dummy jpg image that I want
to show ("MissingPhoto. jpg").
I'm hoping there's an easy way to do that maybe in the EVAL code but I don't
know how. Can someone help me out?
Thanks,
Keith
Comment