<ASP:IMAGE>

  • Thread starter Thread starter Chris Fink
  • Start date Start date
C

Chris Fink

Hello,

Does anyone know of a way to handle broken href image tags either by using
the html img tag or the asp:image server control? For example, if my src
attribute is broken, I would like to display an alternate image, ie one that
blends in with the background instead of the standard eye sore x.

I would imagine I could use the <asp:image> server controls events to check
the src and then change it if it is broken, i am just not clear on how to do
this.

Thanks,
Chris
 
Hi

The image tag has onerror event, at least in explorer

<img onerror="setDefaultImg(this)">

function setDefaultImg(e){
e.src = "theDefaultImage.gif";
}

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Back
Top