菜单切换
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" runat="server" cellpadding="2" cellspacing="2" borderstyle="inset" backcolor="#e8e8e8" width="100%" headerstyle-font-name="Verdana" headerstyle-font-size="12pt" headerstyle-horizontalalign="center" headerstyle-font-bold="True" itemstyle-backcolor="#778899" itemstyle-forecolor="#ffffff" footerstyle-font-size="9pt" footerstyle-font-italic="True"> <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