Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# +webform +USEMAP

Status
Not open for further replies.

McKaulick

Programmer
Oct 24, 2002
35
AR
Hi all, I have an image that I generate dynamically. The thing is, I want to use this image as a image map! So I can click many parts of this image to load a javascript function. The thing is, how can I tell the image to use the right map? Can I put the &quot;<img map>&quot; on the html part of the aspx? The thing is,

I don't see anything like: imgName.usemap=&quot;theMapName&quot;;

Here's how I generate the image:

/*********************************************

System.Web.UI.WebControls.Image imgZoom;
imgZoom = new System.Web.UI.WebControls.Image();
imgZoom.ImageUrl = &quot;../images/zoom.jpg&quot;;
imgZoom.ID = &quot;theZoom&quot;;

**********************************************/

I hope my english is not too bad and I it's clear to understand what I mean!

Thanks in advance...

McKaulick
 
Try to add to the Attributes collection of the image the property for map. That is,

....
imgZoom.Attributes.Add(&quot;USEMAP&quot;, &quot;#mapname&quot;);
...

and define in the html the map with the name given:

<MAP NAME=&quot;mapname&quot;> ...
 
Thanks very much! First try a success!

hehehehe ;o)
 
Nice! I wasn't sure if it would work, but that makes me even happier :) !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top