<%@ Page Language="C#" AutoEventWireup="true"%>

<!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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <input name="ctl00$cont_form$txt_logo" type="text" id="ctl00_cont_form_txt_logo"  style=" display:none"/> 
    <a href="../book/Upload.aspx" target="_blank">上传logo</a>
    </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1" 
        Width="603px">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
                <asp:ImageField DataImageUrlField="logopath"></asp:ImageField>
            <asp:BoundField DataField="logopath" HeaderText="logopath" 
                SortExpression="logopath" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connectionstring %>" 
        DeleteCommand="DELETE FROM [logos] WHERE [id] = @id" 
        InsertCommand="INSERT INTO [logos] ([logopath]) VALUES (@logopath)" 
        SelectCommand="SELECT * FROM [logos] ORDER BY [id] DESC" 
        UpdateCommand="UPDATE [logos] SET [logopath] = @logopath WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="logopath" Type="String" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="logopath" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
