日期:2014-05-20  浏览次数:20526 次

救命啊(对不起,没分了)
我在ASP.NET中写了一个XML,用于显示广告的,代码如下:
<Advertisements>


<AD>
<ImageUrl> \images\adls.jpg </ImageUrl>
<NavigateUrl> Http://www.sina.com.cn </NavigateUrl>
<AlternateText> sss </AlternateText>
<Keyword> 1 </Keyword>
<Impressions> 100 </Impressions>
<Caption> This       is       the       caption       for       Ad#1 </Caption>
</AD>



</Advertisements>
为什么运行的时候一直会提示:Server   Error   in   '/bill '   Application.
--------------------------------------------

The   AdRotator   AdRotator1   found   no   valid   advertisements   in   the   file   'XMLFile1.xml '.  
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.Web.HttpException:   The   AdRotator   AdRotator1   found   no   valid   advertisements   in   the   file   'XMLFile1.xml '.

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.    
谁知道啊,帮帮我啊!


------解决方案--------------------
<?xml version= "1.0 " encoding= "utf-8 " ?>
<Advertisements>
<Ad>
<ImageUrl> /images/adls.jpg </ImageUrl>
<NavigateUrl> http://www.sina.com.cn </NavigateUrl>
<AlternateText> sss </AlternateText>
<Keyword> 1 </Keyword>
<Impressions> 100 </Impressions>
<Caption> This is the caption for Ad#1 </Caption>
</Ad>
改成这个,就是把你的 <AD> 改成 <Ad>
</Advertisements>