ImageMap control example

ImageMap control example

Previous Home Next

 

The ImageMap control provides a server implementation of the HTML  element and its child  elements, allowing sections of images to be used as clickable hot spots. There are three hot spot types:

RectangleHotSpot, to define the bounds of a rectangular portion of the image

CircleHotSpot, to define the bounds of a circular portion of the image

PolygonHotSpot, to define the bounds of an irregular portion of the image

  
     

The RectangleHotSpot has four properties to define its region—Top, Left, Right, and Bottom—which contain pixel values. The CircleHotSpot has three properties—x and y to define the center point and Radius to define the circle radius. Both types of controls have the AlternateText property that sets the tooltip text, as well as the HotSpotMode property that defines what action is to be taken when this image region is clicked. If the HotSpotMode is Navigate, the NavigateUrl is used as the URL to navigate to; if it is Postback, the PostBackValue is passed to the event procedure defined by the OnClick property of the ImageMap control.  

 ......................design code...................................
...................................................................
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>





    Untitled Page


    
                
........................................................................................................................................ .............................cs code............................... using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ImageMap1_Click(object sender, ImageMapEventArgs e) { } }
Previous Home Next