Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

How to: Add ImageMap Web Server Controls to a Web Page (Visual Studio)

An ImageMap control creates a graphic with hotspots that users can click individually. Creating an ImageMap control consists of creating the control, specifying the image, and then separately defining the hotspots.

To add an ImageMap control

  1. From the Standard tab of the Toolbox, drag an ImageMap control onto the page.

  2. In the Properties window, set the control's ImageUrl property to the URL of the graphic that you want to display.


    Click the button in the property box to display the Select Image dialog box.

  3. Optionally, set the control's HotSpotMode property to specify whether clicking the hotspot results in navigation to another page or in a postback.


    You can override the control-wide setting for each hotspot.

To define hotspots

  1. In the Properties window, click the HotSpots property box to display the HotSpot Collection Editor dialog box.

  2. Click the arrow button next to the Add button to select the type of hotspot that you want to create (CircleHotSpot, RectangleHotSpot, PolygonHotSpot).

  3. For each hotspot, use the properties grid to specify the coordinates for the hotspot, as listed in the following table.

  4. If you want to override the control's HotSpotMode setting, set the HotSpotMode property for each hotspot to specify whether clicking the hotspot results in navigation to another page or in a postback.

  5. If a hotspot is set to navigate, specify its NavigateUrl property.

  6. If a hotspot is set to perform a postback, set the PostBackValue for the hotspot to provide information about which hotspot is clicked. You can read the value in the Click event handler.

  7. When you have finished defining hotspots, click OK.

See Also

Community Additions

© 2015 Microsoft