ASP.NET AdRotator Control
Web Server Controls
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 uses
| Element | Description |
|---|---|
| Optional. The path of the image file. | |
| Optional. The URL that the ad links to when the user clicks it. | |
| Optional. Alternative text for the image. | |
| Optional. The category of the ad. | |
| Optional. The display probability. |
property
| property | Description | .NET |
|---|---|---|
| AdvertisementFile | The path of the XML file containing the ad information. | 1.0 |
| AlternateTextField | The data field used instead of the ad's Alt text. | 2.0 |
| ImageUrlField | The data field used instead of the ad's ImageURL attribute. | 2.0 |
| KeywordFilter | Filter ads by category. | 1.0 |
| NavigateUrlField | The data field used instead of the ad's NavigateUrl attribute. | 2.0 |
| runat | Specifies that the control is a server control. Must be set to "server". | 1.0 |
| Target | Specifies where to open the URL. | 1.0 |
Web Control Standard Properties
AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
For a complete description, please visit Web Control Standard Properties。
Web Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
For a complete description, please visit Web Control Standard Properties。
Try it - Example
AdRotator
In this example, we declare an AdRotator control in the .aspx file. Then we create an event handler for the AdCreated event in the .aspx file to override the value of the NavigateUrl element in the XML file.
Web Server Controls