<%@ Page Language="C#"%>
<html>
	<head id="Head1" runat="server">
		<title>Exemplo com o controle Repeater</title>
	</head>
	<body>
		<form id="form1" runat="server">
			<div>
				<asp:SqlDataSource
					id="SqlDataSource1"
					runat="server" ProviderName="System.Data.SqlClient" 
					DataSourceMode="DataReader"
					ConnectionString="<%$ ConnectionStrings:nwind%>"
					SelectCommand="SELECT CustomerID, CompanyName FROM Customers">
				</asp:SqlDataSource>
				<asp:Repeater ID="Repeater1" DataSourceID="SqlDataSource1" runat="server">
					<HeaderTemplate>
						<table>
							<tr>
								<th>ID cliente</th>
								<th>Nome da empresa</th>
							</tr>
					</HeaderTemplate>
					<ItemTemplate>
						<tr>
							<td bgcolor="#CCFFCC">
								<asp:Label runat="server" ID="lblCustomerID"  
								text='<%# Eval("CustomerID") %>' />
							</td>
							<td bgcolor="#CCFFCC">
								<asp:Label runat="server" ID="lblCompanyName" 
								text='<%# Eval("CompanyName") %>' />
							</td>
						</tr>
				 </ItemTemplate>
					<AlternatingItemTemplate>
						<tr>
							<td>
								<asp:Label runat="server" ID="Label3" text='<%# Eval("CustomerID") %>' />
							</td>
							<td>
								<asp:Label runat="server" ID="Label4" 
								text='<%# Eval("CompanyName") %>' />
							</td>
						</tr>
					</AlternatingItemTemplate>
					<FooterTemplate>
						</table>
					</FooterTemplate>
				</asp:Repeater>
			</div>
		</form>
	</body>
</html>

