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 on 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 Alt text of the advertisement. | 2.0 |
ImageUrlField | Data field used instead of the ImageURL attribute of the advertisement. | 2.0 |
KeywordFilter | Filter advertisements based on category. | 1.0 |
NavigateUrlField | Gebruikte datafields in plaats van de NavigateUrl-eigenschap van de adverteerder. | 2.0 |
runat | Stelt dat dit een serverkontrole is. Moet ingesteld worden op "server". | 1.0 |
Target | Waar de URL geopend moet worden. | 1.0 |
Web kontrole standaard eigenschappen
Toegangstoets, Eigenschappen, Achtergrondkleur, Randkleur, Randstijl, Randbreedte CssClass, Ingeschakeld, Lettertype, EnableTheming, Voorgrondkleur, Hoogte, IsIngeschakeld SkinID, Style, TabIndex, ToolTip, Breedte
Voor een volledige beschrijving, bezoek Web kontrole standaard eigenschappen.
Kontrole standaard eigenschappen
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site TemplateControl, TemplateSourceDirectory, UniqueID, Zichtbaar
Voor een volledige beschrijving, bezoekKontrole standaard eigenschappen.
Voorbeeld
- AdRotator
- In dit voorbeeld hebben we een AdRotator-kontrole gedeclareerd in het .aspx-bestand. Vervolgens hebben we een event handler voor het AdCreated-evenement gecreëerd in het .aspx-bestand om de waarde van het NavigateUrl-element in het XML-bestand te overschrijven.