CircleHotSpot 类
定义
public ref class CircleHotSpot sealed : System::Web::UI::WebControls::HotSpot
public sealed class CircleHotSpot : System.Web.UI.WebControls.HotSpot
type CircleHotSpot = class
inherit HotSpot
Public NotInheritable Class CircleHotSpot
Inherits HotSpot
- 继承
示例
下面的代码示例演示如何以声明方式创建 ImageMap 包含两个对象的控件 CircleHotSpot 。The following code example demonstrates how to declaratively create an ImageMap control that contains two CircleHotSpot objects. HotSpotMode属性设置为 HotSpotMode.Navigate ,这会使页面在用户每次单击其中一个作用点区域时导航到指定的 URL。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. 若要使此示例正常工作,必须为属性提供自己的图像 ImageUrl ,并适当地更新图像的路径,以便应用程序可以找到它。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>
<%@ Page Language="VB" %>
<!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"
alternatetext="Shopping choices"
runat="Server">
<asp:circlehotspot
navigateurl="http://www.tailspintoys.com"
x="145"
y="120"
radius="75"
hotspotmode="Navigate"
alternatetext="Shop for toys">
</asp:circlehotspot>
<asp:circlehotspot
navigateurl="http://www.cohowinery.com"
x="145"
y="290"
radius="75"
hotspotmode="Navigate"
alternatetext="Shop for wine">
</asp:circlehotspot>
</asp:imagemap>
</form>
</body>
</html>
注解
此类在控件中定义圆形作用点区域 ImageMap 。This class defines a circle-shaped hot spot region in an ImageMap control. 若要定义对象的区域 CircleHotSpot ,请将 X 属性设置为表示圆形区域中心的 x 坐标的值。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. 将 Y 属性设置为表示圆形区域中心的 y 坐标的值。Set the Y property to the value that represents the y-coordinate of the center of the circular region. 将 Radius 属性设置为从圆的中心到边的距离。Set the Radius property to the distance from the center of the circle to the edge.
CircleHotSpot单击控件时,该页面将导航到 URL,生成回发到服务器的 post 或不执行任何操作。When a CircleHotSpot control is clicked, the page either navigates to a URL, generates a post back to the server, or does nothing. HotSpotMode属性指定此行为。The HotSpotMode property specifies this behavior. 若要导航到 URL,请将 HotSpotMode 属性设置为 HotSpotMode.Navigate ,并使用 NavigateUrl 属性指定要导航到的 url。To navigate to a URL, set the HotSpotMode property to HotSpotMode.Navigate, and use the NavigateUrl property to specify the URL to navigate to. 若要回发到服务器,请将 HotSpotMode 属性设置为 HotSpotMode.PostBack ,并使用 PostBackValue 属性指定对象的名称 CircleHotSpot 。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. 当单击时,此名称将在 ImageMapEventArgs 事件数据中传递 CircleHotSpot 。This name will be passed in the ImageMapEventArgs event data when the CircleHotSpot is clicked. 如果希望对象没有 CircleHotSpot 任何行为,请将 HotSpotMode 属性设置为 HotSpotMode.Inactive 。If you want the CircleHotSpot object to have no behavior, set the HotSpotMode property to HotSpotMode.Inactive.
构造函数
| CircleHotSpot() |
初始化 CircleHotSpot 类的新实例。Initializes a new instance of the CircleHotSpot class. |
属性
| AccessKey |
获取或设置使您可以快速导航至 HotSpot 区域的访问键。Gets or sets the access key that allows you to quickly navigate to the HotSpot region. (继承自 HotSpot) |
| AlternateText |
获取或设置替换文字,该替换文字在图像不可用或是呈现到不支持图像的浏览器时在 HotSpot 控件中代替 ImageMap 对象显示。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. (继承自 HotSpot) |
| HotSpotMode |
获取或设置单击 HotSpot 控件中的 ImageMap 对象时 HotSpot 的行为。Gets or sets the behavior of a HotSpot object in an ImageMap control when the HotSpot is clicked. (继承自 HotSpot) |
| IsTrackingViewState |
获取一个值,该值指示 HotSpot 对象是否跟踪其视图状态更改。Gets a value indicating whether the HotSpot object is tracking its view-state changes. (继承自 HotSpot) |
| MarkupName |
在派生类中重写时,获取 HotSpot 对象的形状的字符串表示形式。When overridden in a derived class, gets the string representation for the HotSpot object's shape. (继承自 HotSpot) |
| NavigateUrl |
获取或设置单击 HotSpot 对象时导航至的 URL。Gets or sets the URL to navigate to when a HotSpot object is clicked. (继承自 HotSpot) |
| PostBackValue |
获取或设置在单击 HotSpot 时在事件数据中传递的 HotSpot 对象名称。Gets or sets the name of the HotSpot object to pass in the event data when the HotSpot is clicked. (继承自 HotSpot) |
| Radius |
获取或设置从圆形区域(由此 CircleHotSpot 对象定义)的中心到边的距离。Gets or sets the distance from the center to the edge of the circular region defined by this CircleHotSpot object. |
| TabIndex |
获取或设置 HotSpot 区域的选项卡索引。Gets or sets the tab index of the HotSpot region. (继承自 HotSpot) |
| Target |
获取或设置目标窗口或框架,单击导航至 URL 的 HotSpot 对象时在其中显示链接到的网页内容。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. (继承自 HotSpot) |
| ViewState |
获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原 HotSpot 对象的视图状态。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. (继承自 HotSpot) |
| X |
获取或设置圆形区域(由此 CircleHotSpot 对象定义)的中心的 x 坐标。Gets or sets the x-coordinate of the center of the circular region defined by this CircleHotSpot object. |
| Y |
获取或设置圆形区域(由此 CircleHotSpot 对象定义)的中心的 y 坐标。Gets or sets the y-coordinate of the center of the circular region defined by this CircleHotSpot object. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetCoordinates() |
返回表示 CircleHotSpot 对象的中心的 x 和 y 坐标及其半径长度的字符串。Returns a string that represents the x- and y-coordinates of a CircleHotSpot object's center and the length of its radius. |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| LoadViewState(Object) |
将 HotSpot 对象以前保存的视图状态还原到该对象。Restores the HotSpot object's previously saved view state to the object. (继承自 HotSpot) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| SaveViewState() |
自页回发到服务器开始,将更改保存到 HotSpot 对象的视图状态。Saves the changes to the HotSpot object's view state since the time the page was posted back to the server. (继承自 HotSpot) |
| ToString() |
返回 String 对象的此实例的 HotSpot 表示形式。Returns the String representation of this instance of a HotSpot object. (继承自 HotSpot) |
| TrackViewState() |
使 HotSpot 对象跟踪对其视图状态所做的更改,以便可以将这些更改存储在该对象的 StateBag 对象中。Causes the HotSpot object to track changes to its view state so they can be stored in the object's StateBag object. 通过 ViewState 属性可访问此对象。This object is accessible through the ViewState property. (继承自 HotSpot) |
显式接口实现
| IStateManager.IsTrackingViewState |
获取一个值,该值指示 HotSpot 对象是否跟踪其视图状态更改。Gets a value indicating whether the HotSpot object is tracking its view-state changes. (继承自 HotSpot) |
| IStateManager.LoadViewState(Object) |
将 HotSpot 对象以前保存的视图状态还原到该对象。Restores the HotSpot object's previously saved view state to the object. (继承自 HotSpot) |
| IStateManager.SaveViewState() |
自页上次回发到服务器开始,将更改保存到 HotSpot 对象的视图状态。Saves the changes to the HotSpot object's view state since the last time the page was posted back to the server. (继承自 HotSpot) |
| IStateManager.TrackViewState() |
指示 HotSpot 区域跟踪对其视图状态所做的更改。Instructs the HotSpot region to track changes to its view state. (继承自 HotSpot) |