<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestRepeater.aspx.cs" Inherits="TestRepeater" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
   <title>Test kontrolki Repeater</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet" />
   <link href="RepeaterLayout1.css" type="text/css" rel="stylesheet" />
</head>
<body>
   <form id="form1" runat="server">
      <div id="container">
         <h1>Test kontrolki Repeater</h1>
         <p>
         Przykład pokazuje, jak używać kontrolki <code>Repeater</code>.
         </p>
         <asp:Repeater ID="rptArtists" runat="server" DataSourceID="dsBooks">
            <HeaderTemplate>
               <h2 class="listHeading">Najnowsze książki</h2>
               <dl>
            </HeaderTemplate>
            <ItemTemplate>
               <dt><%# Eval("Title") %></dt>
               <dd class="bookImage">
                  <asp:Image ID="imgBook" runat="server"
                     ImageUrl='<%# String.Format("images/{0}.gif",Eval("ISBN")) %>'  
                     AlternateText='<%# Eval("Title")%>' />  
               </dd>
               <dd class="publisher">
                  <%# Eval("PublisherName") %> (<%# Eval("YearPublished") %>)
               </dd>
               <dd>
                  <%# Eval("BriefDescription") %> 
               </dd>
            </ItemTemplate>
            <FooterTemplate>
               </dl>
            </FooterTemplate>
         </asp:Repeater>

      <asp:SqlDataSource ID="dsBooks" runat="server"
          ProviderName="System.Data.OleDb" 
          ConnectionString="<%$ ConnectionStrings:Books %>"
          SelectCommand="SELECT TOP 5 ISBN,Title,PublisherName,BriefDescription,YearPublished FROM Publishers INNER JOIN Books ON Publishers.PublisherId=Books.PublisherId ORDER BY YearPublished DESC" />                       
      </div>
   </form>
</body>
</html>
