HtmlImage Src lost

C

Chris

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>");
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top