AdRotator编写轮换广告图片

来源:互联网 发布:上知教育好不好 编辑:程序博客网 时间:2024/04/30 22:31
html代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._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>
    <meta http-equiv="REFRESH" content="5; URL=http://www.baidu.com"/>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/ado.xml" />
        <asp:Image ID="Image1" runat="server" ImageUrl="./images/1.jpg" />
    </div>
    </form>
</body>
</html>

在写xml文件的时候,关键就是里面的字母大小写,如果不按上面的大小写来就会提示很多错误:
主要的错误是提示如下:
找不到 AdvertisementFile 文件等等
活着上面的xml显示在浏览器里面,这些问题都是大小写的原因