导航

AdRotator广告轮询控件配置使用

Posted on 2011-04-05 17:14  yjss  阅读(223)  评论(0编辑  收藏  举报

首先创建一个XML的配置文件

<Advertisements>
<Ad>
<ImageUrl>~/Images/image1.jpg</ImageUrl><!--文件路径-->
<Height>60</Height><!--高度-->
<Width>190</Width><!--宽度-->
<NavigateUrl>http://www.microsoft.com</NavigateUrl><!--URL地址-->
<AlternateText>Microsoft Main Site</AlternateText><!--替代文本-->
<Impressions>80</Impressions><!--频率-->
<Keyword>Topic1</Keyword><!--类别-->
<Caption>This is the caption for Ad#1</Caption>
</Ad>
<Ad>
<ImageUrl>~/Images/image2.jpg</ImageUrl>
<Height>90</Height>
<Width>90</Width>
<NavigateUrl>http://www.wingtiptoys.com</NavigateUrl>
<AlternateText>Wingtip Toys</AlternateText>
<Impressions>80</Impressions>
<Keyword>Topic2</Keyword>
<Caption>This is the caption for Ad#2</Caption>
</Ad>
</Advertisements>

然后设置控件

<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="\arxml.xml"  />