The AdRotator control is used to display a sequence of ad images.
This control uses an XML file to store the ad information. The XML file must begin and end with an <Advertisements> tag. Inside the <Advertisements> tag there may be several <Ad> tags which defines each ad.
File:RandomAd.xml
<
Advertisements>
<Ad>
<ImageUrl>images/banner1.gif</ImageUrl>
<NavigateUrl>http://www.asp.net</NavigateUrl>
<AlternateText>Development for the Asp</AlternateText>
<Keyword>Developers</Keyword>
<Impressions>5</Impressions>
</Ad>
<Ad>
<ImageUrl>images/banner2.gif</ImageUrl>
<NavigateUrl>http://www.codeproject.com</NavigateUrl>
<AlternateText>Up Your ASP</AlternateText>
<Keyword>ASP.NET</Keyword>
<Impressions>5</Impressions>
</Ad>
</Advertisements>
File: AdRotatorPlus.aspx
<%@ Page Language="VB" %>
<html>
<body>
<H1>AdRotator in ASP.NET</H1>
<asp:AdRotator id=myAdRotator runat=server
AdvertisementFile="RandomAd.xml"
BorderWidth=2
/>
</body>
</html>