I am creating images grid in asp.net and I am using the following library Justified Gallery . I am using asp:Repeater
for the same and its working fine. but when any image path from the grid is not found then full grid is not displaying.
my code is
<div id="justifiedGallery">
<asp:Repeater ID="DataListSearchResult"
runat="server">
<ItemTemplate>
<div>
<a href="javascript:ImageDetailWindowNew('<%#Eval("ItemId")%>')">
<img id="img1" style="opacity: 1; filter: alpha(opacity=100);" onerror="imgError(this);" src="/IMAGES/<%#Eval("ImageFile")%>" />
</a>
<div class="caption">
<%#gettitlethumb(Eval("ImageTag"))%>
</div> </div>
</ItemTemplate>
</asp:Repeater>
</div>
I am using a Javascript
function to handle this but its not working.
<script>
function imgError(image) {
image.onerror = "";
image.src = "/images/onerror.gif";
return true;
}
</script>
Take a look on this Fiddle. In this fiddle I am using 3 images but the 2nd image path is incorrect and only two images are displaying.I don't want to hide the Not displaying
image.
Please help me to create this. Thanks