asp.net.ph

Skip Navigation Links

ImageMap Control Syntax

ASP.NET Syntax   ASP.NET Syntax for Web Controls


Creates a control that displays an image on a page. When a hot spot region that is defined within the ImageMap control is clicked, the control either generates a postback to the server or navigates to a specified URL.

Declarative Syntax

For information on the individual members of this class, see ImageMap in the class library.

Remarks

The ImageMap control renders an image that can contain custom-defined hot spot regions. When a user clicks a hot spot region, the control can either generate a postback to the server or navigate to a specified URL.

If you only need to capture the coordinates where the user clicked, and do not require the hot spot capabilities, the Image control can be a serviceable alternative.

Syntax Example

The following example demonstrates how to create an ImageMap control declaratively that contains RectangleHotSpot and CircleHotSpot objects. The HotSpot property is set to HotSpotMode.Navigate, which causes the page to navigate to the specified URL each time a user clicks one of the hot spot regions.

<asp:imagemap id="solarsys"
   imageurl = "~/abkd/shared/images/solarsys.gif"
   width=504 height=126
   alternatetext = "Solar System"
   runat="Server">

   <asp:rectanglehotspot
      alternatetext = "Sun"
      left=0 top=0 right=76 bottom=122
      hotspotmode = "Navigate"
      navigateurl = "/asp.net.ph/shared/images/sun.gif"
      target = "_blank" />

   <asp:circlehotspot
      navigateurl = "/asp.net.ph/shared/images/mercury.gif"
      x=90 y=61 radius=15
      hotspotmode = "Navigate"
      alternatetext = "Mercury"
      target = "_blank" />

   <asp:circlehotspot
      navigateurl = "/asp.net.ph/shared/images/venus.gif"
      x=124 y=61 radius=18
      hotspotmode = "Navigate"
      alternatetext = "Venus"
      target = "_blank" />

      ... other hot spot definitions here ...

</asp:imagemap>

 Show me 

See Also

ImageMap Class   ImageMap Web Server Control



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note