PolygonHotSpot Class
Assembly: System.Web (in system.web.dll)
This class defines a polygon-shaped hot spot region in an ImageMap control. The PolygonHotSpot is useful for defining irregularly shaped hot spot regions in an ImageMap control. For example, you can use it to define individual regions within a geographical map.
To define the region of a PolygonHotSpot, set the Coordinates property to a string that specifies the coordinates of each vertex of the PolygonHotSpot object. A polygon vertex is a point at which two polygon edges meet.
When a PolygonHotSpot object is clicked, the page navigates to a URL, generates a post back to the server, or does nothing. The HotSpotMode property specifies this behavior. To navigate to a URL, set the HotSpotMode property to HotSpotMode.Navigate, and use the NavigateUrl property to specify the URL to navigate to. To post back to the server, set the HotSpotMode property to HotSpotMode.PostBack, and use the PostBackValue property to specify a name for the PolygonHotSpot object. This name will be passed in the ImageMapEventArgs event data when the PolygonHotSpot is clicked. If you want the PolygonHotSpot object to have no behavior, set the HotSpotMode property to HotSpotMode.Inactive.
| Topic | Location |
|---|---|
| How to: Add ImageMap Web Server Controls to a Web Forms Page | Building ASP .NET Web Applications |
| How to: Add ImageMap Web Server Controls to a Web Forms Page | Building ASP .NET Web Applications |
The following code example demonstrates how to create an ImageMap control that contains three PolygonHotSpot objects. Each PolygonHotSpot object represents a geographical region on the map. When the user clicks a PolygonHotSpot object, it posts back to the server and the type and name of the hot spot are displayed in a label.
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.