![]() ![]() | ||
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.
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" />
Tip |
Image controls only display images—if you want to work with Click events and images, use an ImageButton control instead, coming up next. |
![]() ![]() | ||