JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Image Controls

As you can guess from its name, you use Image controls to display images in Web applications. You set the URL of the image with the ImageUrl property. The alignment of the image in relation to other elements on the Web page is specified by setting ImageAlign property (see a book on HTML like the Coriolis HTML Black Book for more on setting image alignment). You can specify the text to display in place of an image if the image is not available by setting the AlternateText property. You can see an Image control at work in Figure 17.1, from the Images example on the CD-ROM.

Click To expand
Figure 17.1: Using an Image control.

There's not really all that much going on in Image controls—they're simply translated to <img> elements. Here's the HTML that displays the image in Figure 17.1:

<img id="Image1" src="Image.jpg" border="0" style="height:150px;width:
300px;Z-INDEX: 101; LEFT: 107px; POSITION: absolute; TOP: 73px" />

Image controls only display images—if you want to work with Click events and images, use an ImageButton control instead, coming up next.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor