ImageRotator Control
Description
The ImageRotator control creates an image that periodically changes. The control allows you to specify the frequency of the change and whether it is to another random image or whether it enumerates through the images in the order they are listed. All code used to rotate through the images is written in JavaScript. The ImageRotator also generates JavaScript that preloads the images to avoid delay when displaying them. Images can be specified as part of the control using RotatorImages as child controls or by specifying an XML file or images directory.
Example
Data From
XML File:
Data From RotatorImage
Child Controls:
Random
Order
Sequential
Order

Properties & Methods
ImageRotatorThe ImageRotator is a simple control that generates an image that periodically changes
  • Height - (Inherited from WebControls.Image) The height, in pixels, of the image
  • Images - The List of RotatorImages obtained from either the XML file or child controls
  • Interval - The amount of time, in milliseconds, between image changes (default="1750")
  • RandomOrder - A Boolean value specifying whether the images should be displayed sequentially or in random order (default="False")
  • Width - (Inherited from WebControls.Image) The width, in pixels, of the image
  • XMLFileName - The XML file that contains the images. If not specified, the ImageRotator will use any images in the directory specified in ImageDirectory. If no ImageDirectory valu is specified, the ImageRotator will look for child controls of type RotatorImage
  • XMLRotatorID - A String value specifying which of the ImageRotator elements in the specified XML file to use. If not specified, the first one will be used
  • ImageDirectory - The directory that contains the images. If both the XMLFileName and ImageDirectory properties are unspecified, the ImageRotator will look for child controls of type RotatorImage
Source Code
Rotators.vb:

Remarks
This control is designed for scenarios in which all images are the same size (this is why the Width/Height properties are in the ImageRotator control instead of with the specific images). I strongly recommend specifying values for the Width/Height properties, especially when using the ImageDirectory property.