<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Main.aspx.cs" Inherits="Main" Title="Main" %>

<%@ Register Src="WebControls/NewsItem.ascx" TagName="NewsItem" TagPrefix="bn" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <br />
    <br />
    <asp:ListView ID="lvNews" EnableViewState="False" runat="server" DataSourceID="ldsNewsItems"
        DataKeyNames="NewsItemID">
        <LayoutTemplate>
            <div id="itemPlaceholder" runat="Server">
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <bn:NewsItem ID="NewsItemMain" runat="server" NewsItem='<%# Container.DataItem %>'
                DataContext='<%# this.DataContext %>' DeleteCommandName="Delete" ShowCommentsLink="true"
                EnableViewState="false" />
        </ItemTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="ldsNewsItems" runat="server" ContextTypeName="BlogNETDataContext"
        TableName="NewsItems" AutoSort="false" OnSelecting="ldsNewsItems_Selecting"
        OnDeleted="ldsNewsItems_Deleted" EnableDelete="true" EnableViewState="false">
    </asp:LinqDataSource>
    <asp:DataPager ID="dpNews" PageSize="5" PagedControlID="lvNews" runat="server" EnableViewState="false"
        QueryStringField="Page">
        <Fields>
            <asp:NextPreviousPagerField FirstPageText="First" PreviousPageText="Previous" ShowPreviousPageButton="true"
                ShowFirstPageButton="true" ShowNextPageButton="false" ButtonCssClass="pager_next_previous" />
            <asp:NumericPagerField ButtonCount="10" NextPageText="..." PreviousPageText="..."
                CurrentPageLabelCssClass="pager_current_page" NumericButtonCssClass="pager_numeric" />
            <asp:NextPreviousPagerField LastPageText="Last" NextPageText="Next" ShowNextPageButton="true"
                ShowLastPageButton="true" ShowPreviousPageButton="false" ButtonCssClass="pager_next_previous" />
        </Fields>
    </asp:DataPager>
    <br />
    <br />
</asp:Content>
