2 out of 2 rated this helpful - Rate this topic

CircleHotSpot Class

Defines a circular hot spot region in an ImageMap control. This class cannot be inherited.

System.Object
  System.Web.UI.WebControls.HotSpot
    System.Web.UI.WebControls.CircleHotSpot

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
public sealed class CircleHotSpot : HotSpot

The CircleHotSpot type exposes the following members.

  Name Description
Public method CircleHotSpot Initializes a new instance of the CircleHotSpot class.
Top
  Name Description
Public property AccessKey Gets or sets the access key that allows you to quickly navigate to the HotSpot region. (Inherited from HotSpot.)
Public property AlternateText Gets or sets the alternate text to display for a HotSpot object in an ImageMap control when the image is unavailable or renders to a browser that does not support images. (Inherited from HotSpot.)
Public property HotSpotMode Gets or sets the behavior of a HotSpot object in an ImageMap control when the HotSpot is clicked. (Inherited from HotSpot.)
Protected property IsTrackingViewState Gets a value indicating whether the HotSpot object is tracking its view-state changes. (Inherited from HotSpot.)
Protected property MarkupName When overridden in a derived class, gets the string representation for the HotSpot object's shape. (Inherited from HotSpot.)
Public property NavigateUrl Gets or sets the URL to navigate to when a HotSpot object is clicked. (Inherited from HotSpot.)
Public property PostBackValue Gets or sets the name of the HotSpot object to pass in the event data when the HotSpot is clicked. (Inherited from HotSpot.)
Public property Radius Gets or sets the distance from the center to the edge of the circular region defined by this CircleHotSpot object.
Public property TabIndex Gets or sets the tab index of the HotSpot region. (Inherited from HotSpot.)
Public property Target Gets or sets the target window or frame in which to display the Web page content linked to when a HotSpot object that navigates to a URL is clicked. (Inherited from HotSpot.)
Protected property ViewState Gets a dictionary of state information that allows you to save and restore the view state of a HotSpot object across multiple requests for the same page. (Inherited from HotSpot.)
Public property X Gets or sets the x-coordinate of the center of the circular region defined by this CircleHotSpot object.
Public property Y Gets or sets the y-coordinate of the center of the circular region defined by this CircleHotSpot object.
Top
  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetCoordinates Returns a string that represents the x- and y-coordinates of a CircleHotSpot object's center and the length of its radius. (Overrides HotSpot.GetCoordinates().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method LoadViewState Restores the HotSpot object's previously saved view state to the object. (Inherited from HotSpot.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method SaveViewState Saves the changes to the HotSpot object's view state since the time the page was posted back to the server. (Inherited from HotSpot.)
Public method ToString Returns the String representation of this instance of a HotSpot object. (Inherited from HotSpot.)
Protected method TrackViewState Causes the HotSpot object to track changes to its view state so they can be stored in the object's StateBag object. This object is accessible through the Control.ViewState property. (Inherited from HotSpot.)
Top
  Name Description
Explicit interface implemetation Private property IStateManager.IsTrackingViewState Infrastructure. Gets a value indicating whether the HotSpot object is tracking its view-state changes. (Inherited from HotSpot.)
Explicit interface implemetation Private method IStateManager.LoadViewState Infrastructure. Restores the HotSpot object's previously saved view state to the object. (Inherited from HotSpot.)
Explicit interface implemetation Private method IStateManager.SaveViewState Infrastructure. Saves the changes to the HotSpot object's view state since the last time the page was posted back to the server. (Inherited from HotSpot.)
Explicit interface implemetation Private method IStateManager.TrackViewState Infrastructure. Instructs the HotSpot region to track changes to its view state. (Inherited from HotSpot.)
Top

This class defines a circle-shaped hot spot region in an ImageMap control. To define the region of the CircleHotSpot object, set the X property to the value that represents the x-coordinate of the center of the circular region. Set the Y property to the value that represents the y-coordinate of the center of the circular region. Set the Radius property to the distance from the center of the circle to the edge.

When a CircleHotSpot control is clicked, the page either 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 CircleHotSpot object. This name will be passed in the ImageMapEventArgs event data when the CircleHotSpot is clicked. If you want the CircleHotSpot 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 CircleHotSpot objects. The HotSpotMode property is set to HotSpotMode.Navigate, which causes the page to navigate to the specified URL each time a user clicks one of the hot spot regions. 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.


<%@ page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="head1" runat="server">
  <title>ImageMap Class Navigate Example</title>
</head>
  <body>
    <form id="form1" runat="server">

      <h3>ImageMap Class Navigate Example</h3>

      <h4>Shopping Choices:</h4>

      <asp:imagemap id="Shop"           
        imageurl="Images/ShopChoice.jpg"
        width="150" 
        height="360"
        alternatetext="Shopping choices" 
        runat="Server">    

        <asp:circlehotspot
          navigateurl="http://www.tailspintoys.com"
          x="75"
          y="290"
          radius="75"
          hotspotmode="Navigate"
          alternatetext="Shop for toys">           
        </asp:circlehotspot> 

        <asp:circlehotspot
          navigateurl="http://www.cohowinery.com"
          x="75"
          y="120"
          radius="75"
          hotspotmode="Navigate"
          alternatetext="Shop for wine">
        </asp:circlehotspot>     

      </asp:imagemap>                 

    </form>      
  </body>
</html>


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ