| ตัวอย่าง Example |
|
<%@ Import Namespace="System.Data" %>
<script runat="server">
sub Page_Load
If Not Page.IsPostBack then
Dim Mycdcatalog=New DataSet
Mycdcatalog.ReadXml(MapPath("testrepeater.xml"))
cdcatalog.DataSource=Mycdcatalog
cdcatalog.DataBind()
End If
End Sub
</script>
<html>
<body><form runat="server">
<asp:Repeater id="cdcatalog" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
<tr>
<th>Title</th>
<th>Artist</th>
<th>Country</th>
<th>Company</th>
<th>Price</th>
<th>Year</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Container.DataItem("title")%></td>
<td><%#Container.DataItem("artist")%></td>
<td><%#Container.DataItem("country")%></td>
<td><%#Container.DataItem("company")%></td>
<td><%#Container.DataItem("price")%></td>
<td><%#Container.DataItem("year")%></td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="6"><hr color="black" /></td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>
|
|
|