HtmlImage Src lost

Discussion in 'ASP .Net Web Controls' started by Chris, Feb 7, 2005.

  1. Chris

    Chris Guest

    I'm creating a enlarged image that needs to be on a layer over a copy
    of the same image to keep it space in the HTML below. I therefore want
    2 copies of the same IMG tag.

    When I render the HtmlImage control twice the src attriute doesn't
    appear for the second IMG tag. I've made the IDs different and even
    tried coping the SRC attribute again. Why is this? Do I have to create
    the HtmlImage all over again?

    HtmlImage image ;
    image = createImage() ;

    Response.Write("<div style='position: relative'>");
    image.RenderControl( new HtmlTextWriter(Response.Output) ) ;
    Response.Write("<div style='position: absolute; z-index: 1'>");
    image.Attributes.Add("onclick", "this.style.width='250px'") ;
    image.Attributes.Add("onmouseout", "this.style.width='80px'") ;
    image.ID = "pop" + image.ID ;
    image.RenderControl( new HtmlTextWriter(Response.Output) ) ;
    Response.Write("</div>");
    Response.Write("</div>");
    Chris, Feb 7, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alberto
    Replies:
    0
    Views:
    322
    Alberto
    May 26, 2004
  2. J

    HtmlImage Problem

    J, Mar 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    350
  3. RKT
    Replies:
    3
    Views:
    932
    Karl Seguin
    Dec 24, 2005
  4. Dave.NET

    System.Web.UI.HtmlControls.HtmlImage

    Dave.NET, Jun 8, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    141
    Dave.NET
    Jun 8, 2004
  5. alto

    HtmlImage.Src not binding dynamically

    alto, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    168
Loading...

Share This Page