请大家帮我检查下为什么下面的代码运行后没有出现效果呢,也不报错??
<%@ 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>
<%@ 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>
解决方案 »
- List泛型和数组的区别?进者有分
- 跪求一个asp.net的上传头像的源代码
- System.Diagnostics.Process.Start(a.txt);为什么只启动了记事本进程 但是不见记事啊~~?
- 大家给推荐几本学习 webservice 的好书吧 !谢谢了!
- 大家说说 一个用ASP.NET1.1作的大型网站,一个经过编译的DLL文件最大的有多大(ASPNET1.1只有一个DLL文件吧)
- IIS配置与FormsAuthentication验证问题
- WebControls和HtmlControls哪个效率更好一点?
- 我先装的。NET,然后装了IIS5。1,这样?急啊!
- jpyc ------------------进来接分
- 网页浏览的问题,50分在线等待
- 把服务器空间的AutoPostBack属性设置为False如何取值
- Gridview中的提交数据问题
大多给缓存有关,见意LZ先清缓存再做测试
<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>