System.Web.UI.WebControls Namespace
Displays a randomly selected ad banner on a Web page.
Visibility |
Constructor |
Parameters |
public |
AdRotator |
( )
|
|
Use the AdRotator control to display a randomly selected advertisement banner on the Web page. The displayed advertisement changes whenever the page refreshes.
Advertisement information is stored in a separate XML file. The XML file allows you to maintain a list of advertisements and their associated attributes. Attributes include the path to an image to display, the URL to link to when the control is clicked, the alternate text to display when the image in not available, a keyword, and the weight of the advertisement. In addition, custom attributes may also be included, such as a custom title.
As an alternative source of data to an XML file, it is possible to provide advertisement information through a call-back event. This event can also be used in combination with the XML file to extend the behavior of the AdRotator control, such as redirecting to another page. See the AdvertisementFile property for additional information on the file format.
A new advertisement is selected whenever the Web page refreshes. An Impressions attribute can be assigned to each advertisement, to control how often an advertisement is selected relative to the other advertisements in the advertisement file.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see AdRotator in ASP.NET Syntax for Web Controls.
AdCreatedEventArgs AdCreatedEventHandler