RectangleHotSpot Class
Defines a rectangular hot spot region in an ImageMap control. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
| Name | Description | |
|---|---|---|
![]() | RectangleHotSpot() | Initializes a new instance of the RectangleHotSpot class. |
| Name | Description | |
|---|---|---|
![]() | AccessKey | |
![]() | AlternateText | |
![]() | Bottom | Gets or sets the y-coordinate of the bottom side of the rectangular region defined by this RectangleHotSpot object. |
![]() | HotSpotMode | |
![]() | Left | Gets or sets the x-coordinate of the left side of the rectangular region defined by this RectangleHotSpot object. |
![]() | MarkupName | |
![]() | NavigateUrl | |
![]() | PostBackValue | |
![]() | Right | Gets or sets the x-coordinate of the right side of the rectangular region defined by this RectangleHotSpot object. |
![]() | TabIndex | |
![]() | Target | |
![]() | Top | Gets or sets the y-coordinate of the top side of the rectangular region defined by this RectangleHotSpot object. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetCoordinates() | Returns a string that represents the x -and y-coordinates of a RectangleHotSpot object's top left corner and the x- and y-coordinates of its bottom right corner.(Overrides HotSpot.GetCoordinates().) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ToString() |
This class defines a rectangular hot spot region in an ImageMap control. To define the region of the RectangleHotSpot object, set the Left property to the value that represents the x-coordinate of the rectangular region's top left corner. Set the Top property to the value that represents the y-coordinate of the rectangular region's top left corner. Set the Right property to the value that represents the x-coordinate of the rectangular region's bottom right corner. Set of the Bottom property to the value that represents the y-coordinate of the rectangular region's bottom right corner.
When a RectangleHotSpot control 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 RectangleHotSpot object. This name will be passed in the ImageMapEventArgs event data when the RectangleHotSpot is clicked. . If you want the HotSpot object to have no behavior, set the HotSpotMode property to HotSpotMode.Inactive.
The following code example demonstrates how to declaratively create an ImageMap control that contains two RectangleHotSpot objects. The ImageMap.HotSpotMode property is set to HotSpotMode.PostBack, which causes the page to post back to the server each time a user clicks one of the hot spot regions. Each time the user clicks one of the RectangleHotSpot objects, the GetCoordinates method is called and the coordinates of the selected hot spot are displayed to the user. For this example to work correctly, you must supply your own image for the ImageUrl property and update the path to the image appropriately so that the application can locate it.
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





