菜单切换
FACESOHO知行者
心灵
记录
远方
源代码:
保存
点击运行
<%@ Import Namespace="System.Data" %>
<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>
<!DOCTYPE html> <html> <body> <form runat="server"> <asp:DataList id="cdcatalog" gridlines="Both" runat="server"> <HeaderTemplate> My CD Catalog </HeaderTemplate> <ItemTemplate> "
<%#Container.DataItem("title")%>
" of
<%#Container.DataItem("artist")%>
- $
<%#Container.DataItem("price")%>
</ItemTemplate> <FooterTemplate> © Hege Refsnes </FooterTemplate> </asp:DataList> </form> </body> </html>
运行结果
My CD Catalog
"Empire Burlesque" of Bob Dylan - $10.90
"Hide your heart" of Bonnie Tyler - $9.90
"Greatest Hits" of Dolly Parton - $9.90
"Still got the blues" of Gary Moore - $10.20
"Eros" of Eros Ramazzotti - $9.90
© Hege Refsnes