案例:ASP.net案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
<%@ Import Namespace="System.Data" %>
2
3
<script  runat="server">
4
sub Page_Load
5
if Not Page.IsPostBack then
6
   dim mycdcatalog=New DataSet
7
   mycdcatalog.ReadXml(MapPath("cdcatalog.xml"))
8
   cdcatalog.DataSource=mycdcatalog
9
   cdcatalog.DataBind()
10
end if
11
end sub
12
</script>
13
14
<html>
15
<body>
16
17
<form runat="server">
18
<asp:DataList
19
id="cdcatalog"
20
gridlines="Both"
21
runat="server">
22
23
<HeaderTemplate>
24
My CD Catalog
25
</HeaderTemplate>
26
27
<ItemTemplate>
28
"<%#Container.DataItem("title")%>" of <%#Container.DataItem("artist")%>  - $<%#Container.DataItem("price")%>
29
</ItemTemplate>
30
31
<FooterTemplate>
32
Copy Right W3xue.com
33
</FooterTemplate>
34
35
</asp:DataList>
36
</form>
37
38
</body>
39
</html>