設定或傳回具有廣告資料的 XML 檔案的路徑。預設值是空字串 ("")。
注意 檔案格式和檔案名稱限制符合對 System.Web.UI.WebControls.AdRotator.AdvertisementFile 屬性描述的限制。
public string AdvertisementFile {
get,
set
}
範例
下列範例示範如何使用 AdvertisementFile 屬性指定含廣告資料的檔案的路徑。
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Adrotator1.AdvertisementFile="ads3.xml"
'The image key is taken from the xml file.
Adrotator1.ImageKey = "ImageUrl1"
End Sub
[C#]
public void Page_Load(Object source, EventArgs e)
{
Adrotator1.AdvertisementFile="ads3.xml";
// The image key is taken from the xml file.
Adrotator1.ImageKey = "ImageUrl1";
}
請參閱
套用至:AdRotator 類別