请大家帮我检查下为什么下面的代码运行后没有出现效果呢,也不报错??
<%@ Import Namespace ="System.Data" %>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat ="server" >
    Sub Page_Load()
        If Not Page.IsPostBack Then
            Dim mycdcatalog = New DataSet
            mycdcatalog.ReadXml(MapPath("cdcatalog.xml"))
            cdcatalog.DataSource = mycdcatalog
            cdcatalog.DataBind()
        End If
    End Sub
</script><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Repeater ID="cdcatalog" runat ="server" >    <HeaderTemplate >
    <table border="0" width="100%">
    <tr>
    <th>Title</th>
    <th>Artist</th>
    <th>Country</th>
    <th>Company</th>
    <th>Price</th>
    <th>Year</th>
    </tr>
    </HeaderTemplate>    <ItemTemplate >
    <tr>
<td><%#Container.DataItem("title")%></td>
<td><%#Container.DataItem("artist")%></td>
<td><%#Container.DataItem("country")%></td>
<td><%#Container.DataItem("company")%></td>
<td><%#Container.DataItem("price")%></td>
<td><%#Container.DataItem("year")%></td>
</tr>
    </ItemTemplate>    <SeparatorTemplate >
    <tr>
<td colspan="6"><hr /></td>
</tr>
    </SeparatorTemplate>    <FooterTemplate >
    </table>
    </FooterTemplate>    </asp:Repeater>
    </div>
    </form>
</body>
</html>

解决方案 »

  1.   

    cdcatalog.xml
    大多给缓存有关,见意LZ先清缓存再做测试
      

  2.   

    一个名为cdcatalog.xml的XML文件,如下;<?xml version="1.0" encoding="utf-8" ?>
    <catalog>
      <cd>
        <title>Empire Burlesque</title>
        <artist>Bob Dylan</artist>
        <country>USA</country>
        <company>Columbia</company>
        <price>10.90</price>
        <year>1985</year>
      </cd>
      <cd>
        <title>Hide your heart</title>
        <artist>Bonnie Tyler</artist>
        <country>UK</country>
        <company>CBS Records</company>
        <price>9.90</price>
        <year>1988</year>
      </cd>
      <cd>
        <title>Greatest Hits</title>
        <artist>Dolly Parton</artist>
        <country>USA</country>
        <company>RCA</company>
        <price>9.90</price>
        <year>1982</year>
      </cd>
      <cd>
        <title>Still got the blues</title>
        <artist>Gary Moore</artist>
        <country>UK</country>
        <company>Virgin records</company>
        <price>10.20</price>
        <year>1990</year>
      </cd>
      <cd>
        <title>Eros</title>
        <artist>Eros Ramazzotti</artist>
        <country>EU</country>
        <company>BMG</company>
        <price>9.90</price>
        <year>1997</year>
      </cd>
    </catalog>
      

  3.   

    代码好常 问题在哪XML读不出来?
      

  4.   

    楼主这个后面就在前台页面的,最上面sub page_load不就是了。还是VB写的不懂的路过