复制代码 代码如下:
生成广告的代码
复制代码 代码如下:
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文档格式
复制代码 代码如下:
鼠标放上去时提示语
鼠标放上去时提示语
鼠标放上去时提示语
注xml
AdvertisementFile:包含广告信息的XML
BorderColor:为广告设置边界颜色,如 BorderColor="#000000" 将边界设为黑色
BorderWidth:边界宽度,单位是象素,如 BorderWidth="1"
CssClass:来自CSS文件或inline STYLE 元素的字体类,如CssClass="clsAds"
Height:广告图象的高度,单位是象素
KeywordFilter:对广告类别进行过滤,如上面例子中所见的
Target:点击广告时URL的目标窗口。如Target="_new" ,每当广告图象被点击都会产生一个新窗口。 “_top”是默认值
Width:广告图象的宽度,单位是象素
AdRotator控件的KeywordFilter属性可以对某一特定类别的广告进行过滤



