System.Web.UI.WebControls.ImageMap.HotSpotMode Property

Gets or sets the default behavior for the System.Web.UI.WebControls.HotSpot objects of an System.Web.UI.WebControls.ImageMap control when the System.Web.UI.WebControls.HotSpot objects are clicked.

Syntax

[System.ComponentModel.DefaultValue(System.Web.UI.WebControls.HotSpotMode.NotSet)]
public virtual HotSpotMode HotSpotMode { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the ImageMap.HotSpotMode property to specify the default click behavior of the System.Web.UI.WebControls.HotSpot objects within an System.Web.UI.WebControls.ImageMap control. This property is set using one of the System.Web.UI.WebControls.HotSpotMode enumeration values. The following table lists the possible values.

Inactive

The System.Web.UI.WebControls.HotSpot object does not have any behavior.

NotSet

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

Navigate

The System.Web.UI.WebControls.HotSpot objects navigate to a URL.

PostBack

The System.Web.UI.WebControls.HotSpot objects generate a postback to the server.

You can specify a System.Web.UI.WebControls.HotSpot object's behavior using either the ImageMap.HotSpotMode property of the System.Web.UI.WebControls.ImageMap control or the HotSpot.HotSpotMode property of each individual System.Web.UI.WebControls.HotSpot object. If both properties are set, the HotSpot.HotSpotMode property specified on each individual System.Web.UI.WebControls.HotSpot object takes precedence over the ImageMap.HotSpotMode property on the System.Web.UI.WebControls.ImageMap control.

When you set the ImageMap.HotSpotMode property of the System.Web.UI.WebControls.ImageMap control, note that the HotSpotMode.NotSet and HotSpotMode.Navigate values have the same behavior: both navigate to a URL. When you specify HotSpotMode.NotSet for the HotSpot.HotSpotMode property of an individual System.Web.UI.WebControls.HotSpot object, that System.Web.UI.WebControls.HotSpot determines its behavior from the value of the ImageMap.HotSpotMode property of the System.Web.UI.WebControls.ImageMap control.

If you specify HotSpotMode.Navigate for the ImageMap.HotSpotMode property, the page navigates to a URL when the System.Web.UI.WebControls.HotSpot is clicked. Use the HotSpot.NavigateUrl property to specify the URL to navigate to.

If you specify HotSpotMode.PostBack for the ImageMap.HotSpotMode property, the page generates a postback to the server when the System.Web.UI.WebControls.HotSpot is clicked. Use the HotSpot.PostBackValue property to specify the name of the hot spot region. This name will be passed in the System.Web.UI.WebControls.ImageMapEventArgs event data when a postback event occurs. When a postback System.Web.UI.WebControls.HotSpot is clicked, the ImageMap.Click event is raised. To programmatically control the actions performed when a postback System.Web.UI.WebControls.HotSpot is clicked, provide an event handler for the ImageMap.Click event.

If you specify HotSpotMode.Inactive for the HotSpot.HotSpotMode property, the System.Web.UI.WebControls.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 System.Web.UI.WebControls.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 System.Web.UI.WebControls.ImageMap control. For example, the following System.Web.UI.WebControls.ImageMap defines an active ring by specifying an inactive circular hot spot within a larger active circular hot spot:

Example

    <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>

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

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

Note:

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

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0