locked
setting ImageMap hotspots dynamically RRS feed

  • Question

  • User1715554878 posted

    Hi guys,

    I am creating a kind of report by generating ImageMap hotspots dynamically and faced with two problems:

    1. I can't find out how to assign each hotspot to ImageMap
    2. Don't know how to assign a tooltip to each hotspot
    Any suggestions? Thanks in advance ;)

     

    Monday, August 27, 2007 2:58 AM

Answers

All replies

  • User1191518856 posted

    Check out this MSDN reference for how to add hotspots to an image map (and also set tooltip):

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.imagemap.hotspots.aspx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 27, 2007 5:41 AM
  • User1476442000 posted

    Well I'd like to answer your questions with an example.

    Suppose I have an ImageMap with Id as "ImageMap1" and a Rectangle Hotspot "RectHotspot"

    then to add a new hotspot to ImageMap1 I would write

    ImageMap1.Hotspots.Add(RectHotspot);

    and If I need a tooltip to appear when the user hovers the mouse over the rectangular region defined by the RectHotspot then I would write

    RectHotspot.AlternateText = "Custom Tooltip";

    Remember, you should set AlternateText property of Recthotspot before adding it to the Hotspots Collection of the ImageMap.

    I hope this post will help you.

    Saturday, April 3, 2010 11:40 AM
  • User803927439 posted

    in the case where the hotspot is already declared in the page :

    ImageMap1.HotSpots.Item(0).AlternateText ="Custom Tooltip"

    (using hotspots collection)

     

    Monday, September 20, 2010 8:28 AM