Programming Microsoft ASP.NET 4 - Dino Esposito [139]
By Root 5742 0
events—Click and Command—that are raised when the control is clicked. The OnClick event handler provides you with an ImageClickEventArgs data structure that contains information about the coordinates for the location at which the image is clicked.
The OnCommand event handler makes the ImageButton control behave like a command button. A command button has an associated name that you can control through the CommandName property. If you have multiple ImageButton controls on the same page, the command name allows you to specify which one is actually clicked. The CommandArgument property can be used to pass additional information about the command and the control.
Finally, the ImageMap control deserves a few words. In its simplest and most commonly used form, the control displays an image on a page. However, when a hot-spot region defined within the control is clicked, the control either generates a postback to the server or navigates to a specified URL. The hot spot is a clickable region within the displayed image. The hot spot is implemented with a class that inherits from the HotSpot class. There are three predefined types of hot spots: polygons, circles, and rectangles.
Check Boxes and Radio Buttons
Check boxes and radio buttons are implemented through the tag and with the type attribute set to checkbox or radio. Unlike the HTML control versions, the Web control versions of check boxes and radio buttons let you specify the associated text as a property. The HTML elements and corresponding HTML controls lack an attribute whose content becomes the text near the check box or radio button. In HTML, to make the text near the check box or radio button clickable, you have to resort to the