Export (0) Print
Expand All

CircleHotSpot Constructor

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

Initializes a new instance of the CircleHotSpot class.

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

public CircleHotSpot ()
public CircleHotSpot ()
public function CircleHotSpot ()

Use this constructor to initialize a new instance of the CircleHotSpot class.

The following code example demonstrates how to programmatically create two CircleHotSpot objects, set their properties, and add them to the ImageMap control's HotSpotCollection. 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#" %>

<script runat="server">
  void Page_Load (Object sender, EventArgs e)
  {
    // Programmatically create a CircleHotSpot object.
    CircleHotSpot Circle1 = new CircleHotSpot();
    Circle1.HotSpotMode = HotSpotMode.Navigate;
    Circle1.NavigateUrl = "http://www.tailspintoys.com";
    Circle1.X = 145;
    Circle1.Y = 120;
    Circle1.Radius = 75;
    Circle1.AlternateText = "Shop for toys";

    // Programmatically create a second CircleHotSpot object.
    CircleHotSpot Circle2 = new CircleHotSpot();
    Circle2.HotSpotMode = HotSpotMode.Navigate;
    Circle2.NavigateUrl = "http://www.cohowinery.com";
    Circle2.X = 145;
    Circle2.Y = 290;
    Circle2.Radius = 75;
    Circle2.AlternateText = "Shop for wine";

    // Add the CirclHotSpot objects to the
    // Shop ImageMap control's HotSpotCollection.    
    Shop.HotSpots.Add(Circle1);
    Shop.HotSpots.Add(Circle2);
  }

</script>

<html>
<head id="Head1" runat="server">
  <title>CircleHotSpot Constructor Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>CircleHotSpot Constructor Example</h3>
      
      <h4>Shopping Choices:</h4>
      
      <asp:imagemap id="Shop"           
        imageurl="Images/ShopChoice.jpg" 
        alternatetext="Shopping choices"
        runat="Server">
      </asp:imagemap>
      
    </form>      
  </body>
</html>

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

Community Additions

ADD
Show:
© 2014 Microsoft