Export (0) Print
Expand All

HotSpot.HotSpotMode Property

Gets or sets the behavior of a HotSpot object in an ImageMap control when the HotSpot is clicked.

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

public virtual HotSpotMode HotSpotMode { get; set; }

Property Value

Type: System.Web.UI.WebControls.HotSpotMode
One of the HotSpotMode enumeration values. The default is Default.

ExceptionCondition
ArgumentOutOfRangeException

The specified type is not one of the HotSpotMode enumeration values.

Use the HotSpotMode property to specify the behavior of a HotSpot object in an ImageMap control when the HotSpot is clicked. This property is set using one of the HotSpotMode enumeration values. The following table lists the possible values.

Value

Description

NotSet

The HotSpot uses the behavior set by the ImageMap control's HotSpotMode property. If the ImageMap control does not define the behavior, the HotSpot objects navigate to a URL.

Inactive

The HotSpot does not have any behavior.

Navigate

The HotSpot navigates to a URL.

PostBack

The HotSpot generates a postback to the server.

You can specify HotSpot behavior on either the HotSpotMode property of the control or on the HotSpotMode property of each individual HotSpot object. If both properties are set, the HotSpotMode property specified on each individual HotSpot object takes precedence over the HotSpotMode property on the ImageMap control.

If you specify HotSpotMode.NotSet for the HotSpotMode property of an individual HotSpot object, the HotSpot gets its behavior from the containing ImageMap control's HotSpotMode property. In this scenario, if the ImageMap control's HotSpotMode property is either not set to a value or is set to HotSpotMode.NotSet, the default behavior is to navigate to a URL.

If you specify HotSpotMode.Navigate for the HotSpotMode property of a HotSpot object, the HotSpot object navigates to a URL when the hot spot region is clicked. Use the NavigateUrl property to specify the URL to navigate to.

If you specify HotSpotMode.PostBack for the HotSpotMode property of a HotSpot object, the HotSpot object generates a post back to the server when the HotSpot is clicked. Use the PostBackValue property to specify a name for the HotSpot. This name will be passed in the ImageMapEventArgs event data on when a postback event occurs. When a postback HotSpot is clicked, the Click event is raised. To programmatically control the actions performed when a postback HotSpot is clicked, provide an event handler for the Click event.

To cause all HotSpot objects in an ImageMap control to have the same behavior, set the HotSpot.HotSpotMode property on each individual HotSpot object to HotSpotMode.NotSet or do not specify a value for the HotSpot.HotSpotMode property.

To specify different behaviors for HotSpot objects in an ImageMap control, set the HotSpot.HotSpotMode property on each individual HotSpot object to either HotSpotMode.Navigate, HotSpotMode.PostBack, or HotSpotMode.Inactive.

NoteNote

If an ImageMap control's ImageMap.HotSpotMode property or the HotSpot.HotSpotMode property on the HotSpot objects it contains is either not set to a value or set to HotSpotMode.NotSet, by default the behavior is HotSpotMode.Navigate.

If you specify HotSpotMode.Inactive for the HotSpot.HotSpotMode property, the HotSpot object does not have any behavior when it is clicked. You can use this value to create an inactive hot spot within a larger active hot spot. This option is provided to allow you to create more complex hot-spot zones within an ImageMap control.

To create an inactive area within an active hot spot, you must specify the inactive hot spot before the active hot spot in the ImageMap control. For example, the following ImageMap defines an active ring by specifying an inactive circular hot spot within a larger active circular hot spot:

<asp:ImageMap ID="SaturnImage" 
  ImageUrl="~/saturn.PNG" 
  runat="server" OnClick="SaturnImage_Click">
  <asp:CircleHotSpot AlternateText="planet" HotSpotMode=PostBack
    PostBackValue="planet" Radius=40 X=100 Y=100 />
  <asp:CircleHotSpot HotSpotMode=Inactive 
    Radius=60 X=100 Y=100 />
  <asp:CircleHotSpot AlternateText="rings" HotSpotMode=PostBack
    PostBackValue="rings" Radius=80 X=100 Y=100 />
</asp:ImageMap>
TopicLocation
How to: Add ImageMap Web Server Controls to a Web Forms PageBuilding ASP .NET Web Applications
How to: Add ImageMap Web Server Controls to a Web Forms PageBuilding ASP .NET Web Applications

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft