<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderForTitleAndIntro" Runat="Server">
<table width="100%" cellpadding="2" cellspacing="0">
<tr valign="top" class="ArticleTitle">
<td style="padding-left:10px;" valign="middle">
asp:AdRotator control</td>
</tr>
<tr>
<td class="ArticleContents">
AdRotator control displays an image and updates both Image and target URL each time the page refreshes.
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
<div class="ArticleContents">
AdRotator control displays an image and updates both Image and target URL each time the page refreshes. When user clicks on the image, he/she is redirected to the target URL.
<p>
Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
are implemented through style properites of <img>. <br />
Generally, AdRotator control is used to show the advertisement banner on the page. The source of advertisements banners are written in a XML file in a certain format.
</p>
Following are some important properties that are very useful.
<table width="100%" class="TutoPropPlaceHolder" border="1" cellpadding="2" cellspacing="1">
<tr>
<td class="DemoCP">AdvertisementFile</td>
<td>
Location of the XML file that contains the image, target URL, and other details.
</td>
</tr>
<tr>
<td class="DemoCP">ImageUrl</td>
<td>
Url of image location.
</td>
</tr>
<tr>
<td class="DemoCP">AlternetText</td>
<td>
Appears if image not loaded properly
</td>
</tr>
<tr>
<td class="DemoCP">NavigateUrl</td>
<td>
The target link that will open when user clicks the image.
</td>
</tr>
<tr>
<td class="DemoCP">Impression</td>
<td>
A number that sets how often an advertisement banner will appear. This number is relative to numbers specified for other ads. eg. a banner with impression 60 will be shown twice as the banner with 30.
</td>
</tr>
<tr>
<td class="DemoCP">KeywordFilter</td>
<td>
Gets or sets a keyword to filter for a specific type of advertisements.
</td>
</tr>
</table>
<!-- START - Demo Section -->
<table class="DemoPlaceHolder" border="1" cellpadding="2" cellspacing="4">
<tr>
<td class="DemoTitle">
DEMO : AdRotator
</td>
<td align="right">
<a class="DemoShowSource" href="../../misc/codeviewer/default.aspx?pagename=~/tutorials/controls/adrotator.aspx" target="_blank">Show Source Code</a>
</td>
</tr>
<tr>
<td>
<asp:AdRotator ID="AdRotator1" runat="Server" AdvertisementFile="~/tutorials/controls/controldata/adRotator.xml"
BorderWidth="1" BorderColor="blue" />
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<!-- START - Server Side Code -->
<pre>
// AdRotator contrl
<asp:AdRotator ID="AdRotator2" runat="Server" AdvertisementFile="~/tutorials/controls/controldata/adRotator.xml"
ImageUrlField="ImageUrl" NavigateUrlField="NavigateUrl" AlternateTextField="AlternateText"
BorderWidth="1" BorderColor="blue" />
// Advertisement File
<Advertisements>
<Ad>
<ImageUrl>~/images/samples/DotNetLogo.gif</ImageUrl>
<NavigateUrl>~/tutorials/controls/listbox.aspx</NavigateUrl>
<AlternateText>Go to ListBox tutorials</AlternateText>
<Impression>30</Impression>
</Ad>
<Ad>
<ImageUrl>~/images/samples/NewAdvance.gif</ImageUrl>
<NavigateUrl>~/tutorials/controls/button.aspx</NavigateUrl>
<AlternateText>Go to Button tutorials</AlternateText>
<Impression>15</Impression>
</Ad>
<Ad>
<ImageUrl>~/images/samples/DotNetFunda3.gif</ImageUrl>
<NavigateUrl>~/tutorials/controls/label.aspx</NavigateUrl>
<AlternateText>Go to Label tutorials</AlternateText>
<Impression>15</Impression>
</Ad>
<Ad>
<ImageUrl>~/images/samples/DotNetFunda2.gif</ImageUrl>
<NavigateUrl>~/tutorials/controls/calendar.aspx</NavigateUrl>
<AlternateText>Go to Calendar control tutorials</AlternateText>
<Impression>40</Impression>
</Ad>
</Advertisements>
</pre>
<!-- END - Server Side Code -->
</td>
</tr>
</table>
<!-- END - Demo Section -->
</div>
<br />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderFooter" Runat="Server">
</asp:Content>
Go Top