案例: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="0" width="100%">
23
<tr>
24
<th align="left">Title</th>
25
<th align="left">Artist</th>
26
<th align="left">Company</th>
27
<th align="left">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
<SeparatorTemplate>
41
<tr>
42
<td colspan="6"><hr /></td>
43
</tr>
44
</SeparatorTemplate>
45
46
<FooterTemplate>
47
</table>
48
</FooterTemplate>