adrotator 无法显示图片
图片放在和XML文件并行的image文件夹内
图片地址用过好多种,就算是用本地连接法(file:///D:\哈哈\haha1\App_Data\image\g.JPG)
也无法显示!
XML代码:
<Advertisements>
<Ad>
<ImageUrl>~/image/g.jpg</ImageUrl>
<NavigateUrl>http://www.google.com</NavigateUrl>
<Keyword>谷歌</Keyword>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/image/163.jpg</ImageUrl>
<NavigateUrl>http://www.163.com</NavigateUrl>
<Keyword>163</Keyword>
<Impressions>50</Impressions>
</Ad>
</Advertisements>
Default.aspx.cs代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/App_Data/XMLFile.xml"
OnAdCreated="AdRotator1_AdCreated1" />
</div>
</form>
</body>
</html>