ASP.NET AdRotator control

Definition and usage

The AdRotator control is used to display a sequence of images.

This control uses an XML file to store ad information. The XML file starts and ends with <Advertisements>. Within the <Advertisements> tag, there should be several <Ad> tags defining each ad.

Predefined elements in the <Ad> tag are listed below:

Property Description
<ImageUrl> Optional. Path to the image file.
<NavigateUrl> Optional. URL linked when the user clicks the ad.
<AlternateText> Optional. Optional text for the image.
<Keyword> Optional. Category of the ad.
<Impressions> Optional. Display probability.

Property

Property Description .NET
AdvertisementFile Path to the XML file containing ad information. 1.0
AlternateTextField Data field used instead of the ad's Alt text. 2.0
ImageUrlField Data field used instead of the ImageURL attribute of the ad. 2.0
KeywordFilter Ads are filtered according to category. 1.0
NavigateUrlField Käytetään korvaamaan mainoksen NavigateUrl-ominaisuus. 2.0
runat Määrittää, että tämä ohjain on palvelinohjain. On asetettava arvoksi "server". 1.0
Target Missä URL avataan. 1.0

Web-ohjain standarde ominaisuudet

AccessKey, Attributes, TaustaVäri, Reunaväri, Reunatyyppi, Reunaleveys 
CssClass, Enabled, Font, EnableTheming, EdellinenVäri, Korkeus, IsEnabled 
SkinID, Style, TabIndex, ToolTip, Leveys

Täydelliselle kuvaukselle vieraile Web-ohjain standarde ominaisuudet.

Ohjain standarde ominaisuudet

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls 
EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site 
TemplateControl, TemplateSourceDirectory, UniqueID, Näkyvä

Täydelliselle kuvaukselle vieraileOhjain standarde ominaisuudet.

Esimerkki

AdRotator
Tässä esimerkissä olemme määrittäneet AdRotator-ohjaimen .aspx-tiedostossa. Sitten luomme .aspx-tiedostossa tapahtumankäsittelijän AdCreated-tapahtumalle, jotta voimme korvata XML-tiedostossa NavigateUrl-elementin arvon.