O'Reilly logo

Programming ASP.NET, 3rd Edition by Dan Hurwitz, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AdRotator Control

This control is called an AdRotator because it is most often used to display advertisements on web pages. It displays an image randomly selected from a list stored either in a separate XML file or a data-bound data source. In either case, the list contains image attributes, including the path to the image and a URL to link to when the image is clicked. The image changes every time the page is loaded.

In addition to the properties inherited from WebControl, the AdRotator control has the properties and events listed in Table 5-10.

Table 5-10. Properties and events of the AdRotator control

Name

Type

Get

Set

Description

AdvertisementFile

String

The path to an XML file that contains the list of advertisements and their attributes. This file is described in detail below.

AlternateTextField

String

Element name from the Advertisement file or data field from which the alternate text is stored. Default is AlternateText.

DataMember

String

The name of the specific list of data the control will bind to.

DataSource

Object

An object from which the control can retrieve data.

DataSourceID

String

The ID of the control from which the AdRotator can retrieve data.

ImageUrlField

String

Element name from the Advertisement file or data field from which the URL for the image is stored. Default is ImageUrl.

KeywordFilter

String

Filters ads displayed to include only those with the specified ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required