This documentation is archived and is not being maintained.

ImageMapEventArgs Class

Provides data for the Click event of an ImageMap control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class ImageMapEventArgs : public EventArgs

The Click event is raised when a HotSpot object in an ImageMap control is clicked. To allow a HotSpot object to raise the Click event, you must first set either the ImageMap::HotSpotMode property or the HotSpot::HotSpotMode property to HotSpotMode.PostBack. To control the actions programmatically that are performed when a postback HotSpot is clicked, provide an event handler for the Click event.

A PostBackValue property stores a string that is associated with the behavior of the HotSpot object when clicked. This string is passed in the ImageMapEventArgs event data when the HotSpot is clicked.

The following code example demonstrates how to create an event handler for the Click event. The ImageMap control 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 RectangleHotSpot objects. The Click event is handled by the VoteMap_Clicked event handler. The VoteMap_Clicked examines the PostBackValue property, sent in the ImageMapEventArgs data, to determine which RectangleHotSpot object is associated with the event. 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.

No code example is currently available or this language may not be supported.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0