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

<!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>Tabela w kontrolce DataList</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet" />
</head>
<body>
   <form id="form1" runat="server">
      <div id="container">
         <h1>Tabela w kontrolce DataList</h1>
         <p>
         W przykładzie pokazano, jak użyć kontrolki <code>DataList</code> w celu wygenerowania
         <code>tabeli</code> HTML.
         </p>
         <asp:DataList ID="dlstPub" runat="server" DataSourceID="dsBooks"
            CellPadding="5" RepeatLayout="Table">

            <ItemTemplate>
               <table>
                  <tr>
                     <td>
                        <asp:Image ID="imgBook" runat="server"
                           ImageUrl='<%# String.Format("images/{0}.gif",Eval("ISBN")) %>'  
                           AlternateText='<%# Eval("Title")%>' />
                     </td>
                     <td valign="top">
                        <p><b><%# Eval("Title") %></b></p>
                     </td>
                  </tr>
               </table>  
            </ItemTemplate>
         </asp:DataList>                   
      </div>
      <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" />                       

   </form>
</body>
</html>
