<ASP:IMAGE>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Fink

    #1

    <ASP:IMAGE>

    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


  • Vidar Petursson

    #2
    Re: &lt;ASP:IMAGE&g t;

    Hi

    The image tag has onerror event, at least in explorer

    <img onerror="setDef aultImg(this)">

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

    --
    Best Regards
    Vidar Petursson
    =============== ===============
    Microsoft Internet Client & Controls MVP
    =============== ===============
    "Chris Fink" <chris@chrisfin k.com> wrote in message
    news:uAni1dSUDH A.2196@TK2MSFTN GP12.phx.gbl...[color=blue]
    > 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[/color]
    that[color=blue]
    > 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[/color]
    check[color=blue]
    > the src and then change it if it is broken, i am just not clear on how to[/color]
    do[color=blue]
    > this.
    >
    > Thanks,
    > Chris
    >
    >[/color]


    Comment

    Working...