<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Products.aspx.cs"
   Inherits="Products" Title="Products" %>
<%@ Register Src="controls/RecentViewsControl.ascx" TagName="RecentViewsControl"
   TagPrefix="uc1" %>
<%@ MasterType VirtualPath="~/Site.master" %>

<asp:Content ID="Content2" ContentPlaceHolderID="sideContent" Runat="Server">  
  <uc1:RecentViewsControl ID="myRecents" runat="server" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="Server">
   <h1>Lista produktów</h1>
   <asp:GridView ID="grdSample" runat="server" DataSourceID="dsBooks" 
      AutoGenerateColumns="False"
      AllowPaging="True" PageSize="4" 
      EnableSortingAndPagingCallbacks="True" 
      ShowHeader="False">
      <Columns>
         <asp:ImageField DataImageUrlField="Isbn" DataImageUrlFormatString="images/{0}.gif"
            DataAlternateTextField="Title" DataAlternateTextFormatString="Okładka {0}"
            ReadOnly="True" />
         <asp:HyperLinkField HeaderText="Tytuł" DataTextField="Title" DataNavigateUrlFormatString="BookDetails.aspx?id={0}"
            DataNavigateUrlFields="Isbn" />
      </Columns>
      
   </asp:GridView>
   <asp:SqlDataSource ID="dsBooks" runat="server" ProviderName="System.Data.SqlClient"
      ConnectionString="<%$ ConnectionStrings:BookCatalog %>" SelectCommand="SELECT ISBN,Title,PublisherName,YearPublished FROM Books INNER JOIN Publishers ON Books.PublisherId=Publishers.PublisherId" />
</asp:Content>
