RectangleHotSpot.GetCoordinates Method
Assembly: System.Web (in system.web.dll)
This method returns a string that represents the coordinates of a RectangleHotSpot object's top left corner and the coordinates of its bottom right corner. This method uses the values assigned to the Left and Top properties to return the coordinates for the top left corner. It uses the values assigned to the Right and Bottom properties to return the coordinates for the bottom right corner.
The GetCoordinates method is used internally by ASP.NET to get the text to use for the coordinates of a RectangleHotSpot when it is rendered. The string that is returned is specific to the browser and markup language.
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.