<ASP:IMAGE>

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
 
V

Vidar Petursson

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
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top