<%@ Page Language="C#" MasterPageFile="~/moden.master" AutoEventWireup="true" CodeFile="ordercar.aspx.cs" Inherits="ordercar" Title="星欣书城" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>


    <asp:GridView ID="dlCar" runat="server" AutoGenerateColumns="False" Width="500px" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowDeleting="dlCar_RowDeleting" OnRowDataBound="dlCar_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="书名">
                <ItemTemplate>
                    <asp:HyperLink ID="hlName" runat="server" NavigateUrl='<%# Eval("book_ID", "~/orderbook.aspx?id={0}") %>'
                        Text='<%# Eval("book_name") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="单价(/元)"> 
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="¥"></asp:Label><asp:Label ID="ol" runat="server" Text='<%# Bind("nowprice") %>' ForeColor="Red"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="数量">
                <ItemTemplate>
                    <asp:TextBox ID="ct" runat="server" BackColor="#FFFFC0" BorderColor="#E0E0E0" MaxLength="10"
                        Width="35px" AutoPostBack="True" OnTextChanged="ct_TextChanged" CausesValidation="True"></asp:TextBox>本
                    <asp:RangeValidator ID="RV" runat="server" ControlToValidate="ct" ErrorMessage="书本数超出范围！"
                        Type="Integer" Width="6px" Display="None" MaximumValue="10000" MinimumValue="1"></asp:RangeValidator>
                    <asp:RequiredFieldValidator ID="RFV" runat="server" ControlToValidate="ct"
                        ErrorMessage="请输入书本数量！" Height="10px" Width="1px" Display="None"></asp:RequiredFieldValidator>
                    <asp:ValidationSummary ID="VS" runat="server" Height="47px" ShowMessageBox="True"
                        ShowSummary="False" DisplayMode="List" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="总计(/元)">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" ForeColor="Red" Text="¥"></asp:Label><asp:Label ID="lball" runat="server" ForeColor="Red" Width="1px"></asp:Label>
                </ItemTemplate>
                
            </asp:TemplateField>
            <asp:CommandField ButtonType="Image" DeleteImageUrl="~/images/trash.gif" ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#EFF3FB" />
        <EditRowStyle BackColor="#2461BF" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
        <EmptyDataTemplate>
            <table>
                <tr>
                    <td align=center style="color:Blue" valign=top>
                        没有图书</td>
                </tr>
            </table>
        </EmptyDataTemplate>
       
    </asp:GridView>
    <div style="width: 467px; height: 1px">
        <asp:Label ID="msg" runat="server" Style="color: #ff0000" Width="302px"></asp:Label></div>
    <div style="width: 481px; height: 17px">
        <a href="default.aspx"></a>&nbsp;<asp:ImageButton ID="deleteBtn" runat="server" ImageUrl="images/cart02.gif"
            OnClick="deleteBtn_Click" CausesValidation="False" />
        &nbsp; &nbsp;
        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/cart04.gif" OnClick="ImageButton1_Click" />&nbsp;
    </div>
    <div align="right" style="width: 479px; height: 22px">
        购物车里有商品：<asp:Label ID="numTxt" runat="server"></asp:Label>件 总数：<asp:Label ID="allNumTxt"
            runat="server"></asp:Label>件 共计：<asp:Label ID="CartPriceTxt" runat="server" Font-Italic="True"></asp:Label>元
        <br />
        <a href="default.aspx">
            <img alt="contine" src="images/goagn.jpg" style="width: 113px; height: 26px" border=0 id="IMG1" language="javascript" /></a>&nbsp;</div>
        </ContentTemplate>
    </asp:UpdatePanel>
    &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp;&nbsp;
</asp:Content>

