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"
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>
相关文章