<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Albums.aspx.cs" Inherits="MyTunes.EntityBinding.Albums" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <asp:Label ID="lblDebugLinq" runat="server" 
            Text="Linq Albums Dataset - View Includes Artist Expression Column" 
            Font-Bold="True" ForeColor="Red"></asp:Label>
    </div>
    <div class="pageSelect">
    <table style="width: 100%;">
    <tr>
    <td>
        <asp:Label ID="lblAlbumSearchLinq" runat="server" Text="Album Quick Search:"></asp:Label>
        <asp:TextBox ID="txtAlbumFilterLinq" runat="server" AutoPostBack="True" 
            ontextchanged="txtAlbumFilterLinq_TextChanged"></asp:TextBox>
        <asp:ImageButton ID="btFilterGoLinq" runat="server" 
            ImageUrl="~/App_Themes/Default/Images/rarrow.gif" 
            onclick="btFilterGoLinq_Click" />
    </td>
    <td style="text-align: center">
        <asp:Label ID="lblPageInfoLinq" runat="server" style="font-style: italic"></asp:Label>
    </td>
    <td style="text-align: right">
        <asp:Label ID="lblPageSelectLinq" runat="server" Text="Jump to:"></asp:Label>
        <asp:DropDownList ID="lstPageSelectLinq" runat="server" 
            onselectedindexchanged="lstPageSelectLinq_SelectedIndexChanged" 
            AutoPostBack="True">
        </asp:DropDownList>
    </td>
    </tr>
    </table>
    </div>
    <asp:GridView ID="AlbumGridView" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="album_id" 
        DataSourceID="EntityDataSource1" PageSize="25" 
    ondatabound="AlbumGridView_DataBound">
        <Columns>
            <asp:BoundField DataField="album_id" HeaderText="album_id" ReadOnly="True" 
                SortExpression="album_id" />
            <asp:TemplateField HeaderText="Artist Name">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" 
                        Text='<%# LookupArtistName(Eval("artist_id")) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="artist_id" HeaderText="artist_id" 
                SortExpression="artist_id" Visible="False" />
            <asp:BoundField DataField="album1" HeaderText="album1" 
                SortExpression="album1" />
        </Columns>
        <PagerSettings Mode="NumericFirstLast" PageButtonCount="25" />
    </asp:GridView>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=MyTunesDatabaseEntities" 
        DefaultContainerName="MyTunesDatabaseEntities" EnableFlattening="False" 
        EntitySetName="albums">
    </asp:EntityDataSource>
</asp:Content>
