| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 534 人关注过本帖
标题:[求助]AdrotAtor控件测试的错误!!
只看楼主 加入收藏
35maoe
Rank: 1
等 级:新手上路
帖 子:341
专家分:0
注 册:2006-8-28
结帖率:100%
收藏
 问题点数:0 回复次数:2 
[求助]AdrotAtor控件测试的错误!!

源代码:

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="C#" runat="server">
public void AdCreated(Object src,AdCreatedEventArgs e)
{
lblImageUrl.Text=(string) e.ImageUrl;
lblNavigateUrl.Text=(string) e.NavigateUrl;
lblAlternateText.Text=(string) e.AlternateText;
}

</script>
</head>
<body>
<form runat="server">
<asp:AdRotator id="ad" AdvertisementFile="ad.xml" BorderWidth="0" OnAdCreated="AdCreated" runat="server" /><br>
当前引用文件:<asp:Label id="lblImageUrl" ForeColor="red" runat="server" /><br>
链接到:<asp:Label id="lblNavigateUrl" ForeColor="red" runat="server" /><br>
说明文字:<asp:Label id="lblAlternateText" ForeColor="red" runat="server" /><br>
</form>
</body>
</html>
############################################################

错误提示:

Server Error in '/123456' Application.
--------------------------------------------------------------------------------

The 'Impressions' start tag on line '8' does not match the end tag of 'Imperessions'. Line 8, position 18.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: The 'Impressions' start tag on line '8' does not match the end tag of 'Imperessions'. Line 8, position 18.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[XmlException: The 'Impressions' start tag on line '8' does not match the end tag of 'Imperessions'. Line 8, position 18.]
System.Xml.XmlTextReader.ParseTag() +2328
System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities() +1478
System.Xml.XmlTextReader.Read() +216
System.Xml.XmlLoader.LoadChildren(XmlNode parent) +33
System.Xml.XmlLoader.LoadElementNode() +144
System.Xml.XmlLoader.LoadCurrentNode() +38
System.Xml.XmlLoader.LoadCurrentNode() +192
System.Xml.XmlLoader.LoadChildren(XmlNode parent) +47
System.Xml.XmlLoader.LoadElementNode() +144
System.Xml.XmlLoader.LoadCurrentNode() +38
System.Xml.XmlLoader.LoadCurrentNode() +192
System.Xml.XmlLoader.LoadChildren(XmlNode parent) +47
System.Xml.XmlLoader.LoadElementNode() +144
System.Xml.XmlLoader.LoadCurrentNode() +38
System.Xml.XmlLoader.LoadCurrentNode() +192
System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102
System.Xml.XmlDocument.Load(XmlReader reader) +72
System.Web.UI.WebControls.AdRotator.LoadFile(String fileName) +227

[HttpException (0x80004005): The AdRotator ad was unable to parse the XML in the AdvertisementFile. The 'Impressions' start tag on line '8' does not match the end tag of 'Imperessions'. Line 8, position 18.]
System.Web.UI.WebControls.AdRotator.LoadFile(String fileName) +731
System.Web.UI.WebControls.AdRotator.GetFileData(String fileName) +148
System.Web.UI.WebControls.AdRotator.SelectAdFromFile() +39
System.Web.UI.WebControls.AdRotator.OnPreRender(EventArgs e) +72
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

搜索更多相关主题的帖子: AdrotAtor 控件 
2006-09-06 14:43
35maoe
Rank: 1
等 级:新手上路
帖 子:341
专家分:0
注 册:2006-8-28
收藏
得分:0 
ad.xml代码:

<?xml version="1.0" encoding="gb2312"?>
<Advertisements>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/ff.gif</ImageUrl>
<NavigateUrl>http://www.ejieju.com</NavigateUrl>
<AlternateText>广告牌1</AlternateText>
<Keyword>1</Keyword>
<Impressions>50</Imperessions>
</Ad>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/guanjianzi.gif</ImageUrl>
<NavigateUrl>http://www.ejieju.com</NavigateUrl>
<AlternateText>广告牌2</AlternateText>
<Keyword>2</Keyword>
<Impressions>50</Imperessions>
</Ad>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/top-gg.gif</ImageUrl>
<NavigateUrl>http://www.ejieju.com</NavigateUrl>
<AlternateText>广告牌3</AlternateText>
<Keyword>3</Keyword>
<Impressions>50</Imperessions>
</Ad>
</Advertisements>

2006-09-06 14:44
lirui
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-5-7
收藏
得分:0 
你的XML文件里面错误的地方很多,,,
我帮你改了一下:
<?xml version="1.0" encoding="gb2312"?>
<Advertisements>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/ff.gif<;/ImageUrl>
<NavigateUrl>http://www.ejieju.com<;/NavigateUrl>
<AlternateText>广告牌1</AlternateText>
<Keyword>1</Keyword>
<Impressions>50</Imperessions>
</Ad>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/guanjianzi.gif<;/ImageUrl>
<NavigateUrl>http://www.ejieju.com<;/NavigateUrl>
<AlternateText>广告牌2</AlternateText>
<Keyword>2</Keyword>
<Impressions>50</Imperessions>
</Ad>
<Ad>
<ImageUrl>http://www.ejieju.com/guanggao/top-gg.gif<;/ImageUrl>
<NavigateUrl>http://www.ejieju.com<;/NavigateUrl>
<AlternateText>广告牌3</AlternateText>
<Keyword>3</Keyword>
<Impressions>50</Imperessions>
</Ad>
</Advertisements>
2006-10-12 09:05
快速回复:[求助]AdrotAtor控件测试的错误!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026981 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved