ASP.NET HTML 控件 用 的DataList

asp.net html 控件 用 的datalist

<%@ 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"
alternatingitemstyle-backcolor="#e8e8e8"
alternatingitemstyle-forecolor="#000000"
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>

<alternatingitemtemplate>
"<%#container.dataitem("title")%>" of <%#container.dataitem("artist")%>  - $<%#container.dataitem("price")%>
</alternatingitemtemplate>

<footertemplate>
© hege refsnes
</footertemplate>

</asp:datalist>
</form>

</body>
</html>
相关文章