案例:ASP.net案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
2
<%@ Import Namespace="System.Data" %>
3
4
<script  runat="server">
5
sub Page_Load
6
if Not Page.IsPostBack then
7
   dim mycdcatalog=New DataSet
8
   mycdcatalog.ReadXml(MapPath("cdcatalog.xml"))
9
   cdcatalog.DataSource=mycdcatalog
10
   cdcatalog.DataBind()
11
end if
12
end sub
13
</script>
14
15
<html>
16
<body>
17
18
<form runat="server">
19
<asp:Repeater id="cdcatalog" runat="server">
20
21
<HeaderTemplate>
22
<table border="1" width="100%">
23
<tr>
24
<th>Title</th>
25
<th>Artist</th>
26
<th>Company</th>
27
<th>Price</th>
28
</tr>
29
</HeaderTemplate>
30
31
<ItemTemplate>
32
<tr>
33
<td><%#Container.DataItem("title")%> </td>
34
<td><%#Container.DataItem("artist")%> </td>
35
<td><%#Container.DataItem("company")%> </td>
36
<td><%#Container.DataItem("price")%> </td>
37
</tr>
38
</ItemTemplate>
39
40
<FooterTemplate>
41
</table>
42
</FooterTemplate>
43
44
</asp:Repeater>
45
</form>
46
47
</body>
48
</html>