当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP.NET高级应用(1)

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP.NET高级应用(1)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 210 ::
收藏到网摘: n/a

       XML及其应用
  
    XML 是标准扩展语言的简称,是未来Web编程的标准。在这一章中,我们将讲述XML在ASP.NET中的应用
  
    制作广告条
  
    在这个程序中,我们通过XML语言实现每次访问网页时,将显示不同的广告条。在本例中,我们只调用了两条广告
    源文件:advanceapp\intro.aspx
  
    Intro.aspx的代码如下:
  
  
  
  <html>
  <center><title>广告条演示</title></center>
  <head>
  <link rel="stylesheet"href="intro.css">
  </head>
  <body>
  <center>
  <form action="intro.aspx" method="post" runat="server">
  <h2>广告条演示</h2>
  <asp:adrotator AdvertisementFile="intro.xml" BorderColor="black" BorderWidth=1 runat="server"/>
  </form>
  </center>
  </body>
  </html>
  
  intro.xml的 代码如下:
  <Advertisements>
  <Ad>
  <ImageUrl>./hp1.gif</ImageUrl>
  <NavigateUrl>http://www.yesky.com</NavigateUrl>
  <AlternateText>欢迎访问!</AlternateText>
  <Keyword>Computers</Keyword>
  <Impressions>80</Impressions>
  </Ad>
  
  <Ad>
  <ImageUrl>./hp2.gif</ImageUrl>
  <NavigateUrl>http://www.yesky.com</NavigateUrl>
  <AlternateText>欢迎访问</AlternateText>
  <Keyword>Computers</Keyword>
  <Impressions>80</Impressions>
  </Ad>
  </Advertisements>
  
  
    在intro.aspx中,我们使用了<asp:adrotator AdvertisementFile="intro.xml" BorderColor="black" BorderWidth=1 runat="server"/>这条语句来嵌入intro.xml文件。