
AdRotator | 735
MobileControls
Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
AdRotator
System.Web.UI.MobileControls (system.web.mobile.dll)
.NET 1.1, disposable
class
The AdRotator control allows you display a randomly selected image on a mobile page.
Every time the page is refreshed, a new image will be selected from the list specified in
the associated XML configuration file (referenced by the AdvertisementFile property). The
AdRotator works in almost exactly the same manner as the full-scale ASP.NET System.Web.
UI.WebControls.AdRotator web control, using the same XML configuration file format, and
raising the same AdCreated event (which allows you to update other parts of the mobile
page to correspond with the dynamically selected advertisement). The only significant
difference is the addition of the ImageKey property, which allows you to specify an alter-
nate image URL. For example, if you set ImageKey to ImageUrl1, ASP.NET will render the
image specified by the <ImageUrl1> element in the randomly selected advertisement,
instead of the image specified by the default <ImageUrl> element. This gives you the flex-
ibility to create mobile pages that support multiple different devices, each of which
may require a different image format, by adding multiple custom image URLs.
Figure 40-4
. Attributes and collections
System System.W ...