Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CircleHotSpot Class

Note: This class is new in the .NET Framework version 2.0.

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

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

public sealed class CircleHotSpot : HotSpot
public final class CircleHotSpot extends HotSpot
public final class CircleHotSpot extends HotSpot

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.

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

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#" %>

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

System.Object
   System.Web.UI.WebControls.HotSpot
    System.Web.UI.WebControls.CircleHotSpot
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 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.