Lesson 1: Exploring Specialized Web Server Controls in .NET framework

Generator QR Code 2d barcode in .NET framework Lesson 1: Exploring Specialized Web Server Controls

Lesson 1: Exploring Specialized Web Server Controls
Encoding QR Code JIS X 0510 In VS .NET
Using Barcode creator for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
www.OnBarcode.com
Bar Code Creator In .NET
Using Barcode drawer for ASP.NET Control to generate, create barcode image in ASP.NET applications.
www.OnBarcode.com
WebControl Class Control
Creating QR Code ISO/IEC18004 In C#.NET
Using Barcode generator for .NET Control to generate, create Quick Response Code image in Visual Studio .NET applications.
www.OnBarcode.com
QR Code 2d Barcode Generation In .NET Framework
Using Barcode maker for Visual Studio .NET Control to generate, create QR Code 2d barcode image in .NET framework applications.
www.OnBarcode.com
ImageMap Class Image Properties Enabled HotSpotMode Target Methods New Events Click HotSpots
Create QR Code In Visual Basic .NET
Using Barcode generator for VS .NET Control to generate, create QR Code ISO/IEC18004 image in .NET applications.
www.OnBarcode.com
EAN / UCC - 13 Creator In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create UCC-128 image in ASP.NET applications.
www.OnBarcode.com
HotSpot MustInherit Class Properties AccessKey AlternateText HotSpotMode NavigateUrl PostBackValue TabIndex Target Methods GetCoordinates ToString
Creating USS Code 128 In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create Code 128 Code Set A image in ASP.NET applications.
www.OnBarcode.com
Generate Bar Code In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create barcode image in ASP.NET applications.
www.OnBarcode.com
Image Class WebControl
Code 39 Extended Printer In .NET Framework
Using Barcode generator for ASP.NET Control to generate, create ANSI/AIM Code 39 image in ASP.NET applications.
www.OnBarcode.com
Encode EAN13 In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create EAN-13 Supplement 5 image in ASP.NET applications.
www.OnBarcode.com
CircleHotSpot NotInheritable Class HotSpot Properties Radius X Y Methods GetCoordinates New
Creating UPC-A Supplement 5 In VS .NET
Using Barcode creator for ASP.NET Control to generate, create Universal Product Code version A image in ASP.NET applications.
www.OnBarcode.com
Bookland EAN Printer In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create International Standard Book Number image in ASP.NET applications.
www.OnBarcode.com
PolygonHotSpot NotInheritable Class HotSpot Properties Coordinates Methods GetCoordinates New
PDF-417 2d Barcode Reader In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Draw PDF 417 In Visual Basic .NET
Using Barcode encoder for Visual Studio .NET Control to generate, create PDF-417 2d barcode image in .NET framework applications.
www.OnBarcode.com
RectangleHotSpot NotInheritable Class HotSpot Properties Bottom Left Right Top Methods GetCoordinates New
Printing UPC - 13 In Objective-C
Using Barcode generator for iPad Control to generate, create UPC - 13 image in iPad applications.
www.OnBarcode.com
Barcode Reader In Visual Studio .NET
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
Figure 3-9
Paint Code 39 In None
Using Barcode generator for Font Control to generate, create ANSI/AIM Code 39 image in Font applications.
www.OnBarcode.com
GTIN - 13 Encoder In C#
Using Barcode generation for .NET Control to generate, create EAN-13 Supplement 5 image in .NET framework applications.
www.OnBarcode.com
The ImageMap and HotSpot control hierarchy.
Bar Code Encoder In Visual Basic .NET
Using Barcode creation for VS .NET Control to generate, create bar code image in .NET applications.
www.OnBarcode.com
Matrix Barcode Generator In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Matrix 2D Barcode image in VS .NET applications.
www.OnBarcode.com
The ImageMap control has a Click event that functions like the Button control. The sec ond argument of the Click event has a data type of ImageMapEventArgs, which lets you retrieve the PostBackValue of the associated hot spot that the user clicked. In the source view, the ImageMap control is represented as the <asp:ImageMap> ele ment and has nested hot spot elements that can be CircleHotSpot, RectangleHotSpot, and PolygonHotSpot elements.
Working with HotSpot Controls
A hot spot is a predefined area on an image that can be clicked to perform an action. Hot spots can be created to define areas on the image that are displayed by the ImageMap control. You can define many overlapping areas, with each layer based on the HotSpot definition order. The first HotSpot defined takes precedence over the last
3
Exploring Specialized Server Controls
HotSpot defined. The HotSpot object model is shown in Figure 3-9. The classes that inherit from the HotSpot are the CircleHotSpot, RectangleHotSpot, and PolygonHotSpot. Table 3-2 contains the list of HotSpot properties.
Table 3-2
HotSpot Properties
Property AccessKey
Description A tool that specifies the keyboard shortcut for a HotSpot. You can place only a single character into this property. If this property contains C, for example, a Web user can press Alt+C to navigate to the HotSpot. The text that is displayed for a HotSpot when the image is unavailable or renders to a browser that does not support images. This also becomes the ToolTip. A tool that specifies the behavior of the HotSpot when it is clicked. Can be NotSet, Inactive, Navigate, or PostBack. The URL to navigate to when a HotSpot object is clicked. The string that is passed back to the Web server and is avail able in the event argument data when the HotSpot is clicked. The tab index number of the HotSpot. The target window or frame that displays the Web page and is linked to the HotSpot.
AlternateText
HotSpotMode NavigateUrl PostBackValue TabIndex Target
Understanding the HotSpotMode Property
The HotSpotMode property is used to specify how the HotSpot behaves when the HotSpot is clicked. You can specify the HotSpotMode on either the HotSpot or the ImageMap control. If you set the HotSpotMode on the HotSpot and the ImageMap, the HotSpot takes precedence. This means that you can specify the HotSpotMode on the ImageMap control to set a default HotSpot behavior, but the HotSpotMode of the HotSpot must be set to NotSet to inherit the behavior from the HotSpot. Specifying Navigate for the HotSpotMode causes the HotSpot to navigate to a URL when the HotSpot is clicked. The NavigateUrl property specifies the URL to navigate to.
Lesson 1: Exploring Specialized Web Server Controls
NOTE
HotSpotMode Default
If the ImageMap and HotSpot have their HotSpotModes set to NotSet, the HotSpots default to Navigate.
Specifying PostBack for the HotSpotMode causes the HotSpot to generate a PostBack to the server when the HotSpot is clicked. The PostBackValue property specifies a string that is passed back to the Web server in the ImageMapEventArgs event data when the HotSpot is clicked and the Click event is raised. Specifying Inactive for the HotSpotMode indicates that the HotSpot does not have any behavior when it is clicked. This is used to create an inactive HotSpot region within a larger active HotSpot, thus allowing you to create complex HotSpot zones within an ImageMap control. You must specify the inactive HotSpot before you designate the active HotSpot in the ImageMap control. In this example, a Web page was created and a Label and ImageMap control were added to the page. The ImageMap control uses the same image file called Girl.gif and HTML page called ImageDescription.htm that were used in the previous Image and ImageButton control examples. The following code was added to the code-behind page to show how the ImageMap control s properties can be set programmatically and the Click event can be implemented to display the HotSpot that is clicked.
'VB Partial Class ImageMap_Control Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ImageMap1.ImageUrl = "~/Images/Girl.gif" ImageMap1.DescriptionUrl = "~/ImageDescription.htm" ImageMap1.AlternateText = "This is a picture of a girl" ImageMap1.HotSpotMode = HotSpotMode.PostBack Dim chs As CircleHotSpot Dim rhs As RectangleHotSpot Dim phs As PolygonHotSpot chs = New CircleHotSpot() chs.X = 75 chs.Y = 75 chs.Radius = 6 chs.PostBackValue = "Left Eye Center" ImageMap1.HotSpots.Add(chs) chs = New CircleHotSpot() chs.X = 100 chs.Y = 75 chs.Radius = 6
Copyright © OnBarcode.com . All rights reserved.