mercredi 8 février 2017

How to hide a broken ASP.NET Image Control

I've only been able to find how to hide broken images for an image added with tag.

i.e.<img src="sample.jpg" onerror="this.style.display='none';">

How would I do this in .net with an image control?

Here's my code:

<asp:Image  AlternateText='<%#Eval("DisplayName") %>'  ID="newsImage" width="77" height="57" align="middle" valign="top" runat="server"  Visible='<%# Eval("ImageName").ToString() != "" %>'  ImageUrl='<%#String.Format("../images/products/{0}", Eval("ImageName")) %>' />




Aucun commentaire:

Enregistrer un commentaire