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

<!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 FormView</title>
	<link href="chapterStyles.css" type="text/css" rel="stylesheet" />
	<style type="text/css">
		.dataValues { font-weight: bold; }
		.singleBook { border-top: 1pt solid #E7E7E7;
		              border-left: 1pt solid #E7E7E7;
		              border-bottom: 1pt solid #D2D2D2;
		              border-right: 1pt solid #D2D2D2;
		              padding: 1em;	
		              margin: 1em;              
		              background: #FFFFE0;		              
		               }
		 .singleBookTitle {
                    vertical-align: middle;
                    text-align: center;
		              background: #FFFFCC;
		              }
		  .entireForm {
		            border: 2pt solid #D7D7D7; 
		  }
	</style>
</head>
<body>
	<form id="form1" runat="server">
		<div id="container">
			<h1>Test kontrolki FormView</h1>
			<p>
			W przykładzie pokazano, jak używac kontrolki <code>FormView</code>.
			</p>
<asp:FormView ID="frmvBooks" runat="server" DataSourceID="dsBooks" 
      CssClass="entireForm" AllowPaging="true">
   <HeaderTemplate>
      <h2>Informacje o książce</h2>
   </HeaderTemplate>
   <HeaderStyle CssClass="singleBookTitle" />
	<ItemTemplate>
		<div class="singleBook">
		ISBN: <br />
		<asp:Label ID="labIsbn" runat="server"
		  Text='<%# Eval("ISBN") %>' CssClass="dataValues" /><br />
		Title:<br />
		<asp:Label ID="labTitle" runat="server"
		  Text='<%# Eval("Title") %>' CssClass="dataValues" /><br />
		Year:<br />
	   <asp:Label ID="labDesc" runat="server"
		  Text='<%# Eval("YearPublished") %>' CssClass="dataValues" /><br />
		Description:<br />
	   <asp:Label ID="Label1" runat="server"
		  Text='<%# Eval("BriefDescription") %>' CssClass="dataValues" /><br />                 
		</div>
	</ItemTemplate>
	<PagerStyle CssClass="singleBookTitle" />
   <PagerTemplate>
      <asp:ImageButton id="ibtnPrev" runat="server"
        CommandName="Page" CommandArgument="Previous" ImageUrl="images/page_previous.gif" />
      <asp:ImageButton id="ibtnNext" runat="server"
        CommandName="Page" CommandArgument="Next" ImageUrl="images/page_next.gif" />
      <br />
      <asp:ImageButton id="ibtnFirst" runat="server"
        CommandName="Page" CommandArgument="First" ImageUrl="images/page_first.gif" />
      <asp:ImageButton id="ibtnLast" runat="server"
        CommandName="Page" CommandArgument="Last" ImageUrl="images/page_last.gif" />
   </PagerTemplate>
</asp:FormView>

		</div>
		<asp:SqlDataSource ID="dsBooks" runat="server"
			 ProviderName="System.Data.OleDb" 
			 ConnectionString="<%$ ConnectionStrings:Books %>"
			 SelectCommand="SELECT ISBN,Title,PublisherId,BriefDescription,YearPublished FROM Books" />                       

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