ASP.Net Imagemap Control

Updated on 22 Dec 2009, Published on 18 Dec 2009

The ASP.Net Imagemap control provides the functionality to display the image defined with special regions that can be clicked by the user to navigate to other page or perform the PostBack event. The Imagemap control is a combination of two types of server elements. The first element is an Image that provides the properties of ASP.Net Image control to display the image on the web page. The second element is hotspot or collection of hotspots which enable you to define the special hotspot regions on the associated image that can be clicked by the user to navigate or send the web page to the server. The HotSpot regions of ASP.Net Imagemap controls defines the shapes based on the x and y axis to specify the location of the hotspot on the image. You can define the three types of hotspots for the imagemap control that represent the specific shapes such as circle, rectangle and polygon.

ImageMap Control Examples:

You can see the live samples and examples of ImageMap Control from the following links:

Properties of ASP.Net Imagemap Control

The parent tag of the Imagemap control has all the properties of ASP.Net Image control that allow you to specify the location of image and its alternate text as discussed below:

1. AlternateText: It allows you to specify the alternate text value for the image.

2. DescriptionUrl: You can specify the URL of the web page containing the full description about the image to the DescriptionUrl property of Imagemap control.

3. GenerateEmptyAlternateText: It accepts the Boolean value such as true or false that allows or disallows the generation of empty alternate text property in the HTML source code.

4. HotSpotMode: This property accepts one of the names of the predefined HotSpotModes that define the behavior of the Hotspot region of the Imagemap control. The predefined values are Inactive, Navigate, NotSet and PostBack.

5. ImageAlign: It enables you to set the alignment of the displayed image with respect to the other content or HTML elements placed inline to it.

6. ImageUrl: You can specify the URL of the image to this property that you want to display on web page.

7. Target: It allows you to specify the name of the target frame in which you want to open the navigation link.

Server Side Events of Imagemap Control

The ASP.Net Imagemap control supports only OnClick server side event that can be handled at server side to respond to the click event raised by the user by clicking the hotspot region of the image map. It provides only a single common click event handler for multiple hotspot regions defined for the image. Later on we will learn how execute the specific piece of code based on the hotspot region clicked by the user.

Continue to the next tutorial: ASP.Net Imagemap Hotspot Shapes to learn how to define the coordinates for the different types of hotspot regions associated the imagemap control.

Product Spotlight

Share it
Rate this article:
Email it:
email

0 Responses to "ASP.Net Imagemap Control"
Leave a Reply

Name   (Required)


Mail   (will not be published) (Required)


Website   (http://www.example.com)




OR Subscribe via Email: