复制代码 代码如下:
<asp:AdRotator runat="server" AdvertisementFile="~/XMLFile.xml" />
复制代码 代码如下:
adRotator.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class myTest_advertisement : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ad_Created(object sender, AdCreatedEventArgs e)
{
if ((string)e.AdProperties["Animal"] != "")
Label1.Text = (string)e.AdProperties["Aniaml"];
else
Label1.Text = "n.a.";
}
}
复制代码 代码如下:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>图片路径(本地)</ImageUrl>
<NavigateUrl>图片连接</NavigateUrl>
<AlternateText>鼠标放上去时提示语</AlternateText>
<Keyword>关键字</Keyword>
<Impressions>优先级</Impressions>
</Ad>
<Ad>
<ImageUrl>图片路径(本地)</ImageUrl>
<NavigateUrl>图片连接</NavigateUrl>
<AlternateText>鼠标放上去时提示语</AlternateText>
<Keyword>关键字</Keyword>
<Impressions>优先级</Impressions>
</Ad>
<Ad>
<ImageUrl>图片路径(本地)</ImageUrl>
<NavigateUrl>图片连接</NavigateUrl>
<AlternateText>鼠标放上去时提示语</AlternateText>
<Keyword>关键字</Keyword>
<Impressions>优先级</Impressions>
</Ad>
</Advertisements>
新闻热点
疑难解答
图片精选