<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" Title="MusicStore - Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CenterContentPlaceHolder" Runat="Server">
    <div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MusicStoreDBConnection %>"
            SelectCommand="GetSearchResults" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="False">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBoxSearchTerm" DefaultValue="" Name="searchString"
                    PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:Label ID="Label2" runat="server" Text='Enter a search term in the text box and then click "Search"'></asp:Label>
    </div>
    <asp:TextBox ID="TextBoxSearchTerm" runat="server" Width="491px" OnTextChanged="TextBoxSearchTerm_TextChanged"></asp:TextBox>
    <asp:Button ID="ButtonSearch" runat="server" Text="Search" Width="106px" OnClick="ButtonSearch_Click" />
    &nbsp;<br />
    <asp:Label ID="LabelSongsGrid" runat="server" Text="All songs in the music store:"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" CellPadding="4" DataSourceID="SqlDataSource1"
        ForeColor="#333333" GridLines="None" Width="487px" AutoGenerateColumns="False" Font-Size="Small">
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="SongTitle" HeaderText="Song Title" />
            <asp:BoundField DataField="ArtistName" HeaderText="Artist Name" />
            <asp:BoundField DataField="AlbumTitle" HeaderText="Album Title" />
            <asp:BoundField DataField="GenreName" HeaderText="Genre" />
        </Columns>
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="RightContentPlaceHolder" Runat="Server">
    <p>Common searches:</p>
    <br />
    <p>"Jazz"</p>
    <p>"U2"</p>
    <p>"Soundtracks"</p>
</asp:Content>

