<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BlogConnectionString1 %>" 
            DeleteCommand="DELETE FROM [Photos] WHERE [Photo_ID] = @Photo_ID" 
            InsertCommand="INSERT INTO [Photos] ([Photo_Name], [Photo_Intro], [Photo_Url], [AddDate]) VALUES (@Photo_Name, @Photo_Intro, @Photo_Url, @AddDate)" 
            SelectCommand="SELECT * FROM [Photos]" 
            UpdateCommand="UPDATE [Photos] SET [Photo_Name] = @Photo_Name, [Photo_Intro] = @Photo_Intro, [Photo_Url] = @Photo_Url, [AddDate] = @AddDate WHERE [Photo_ID] = @Photo_ID">
            <DeleteParameters>
                <asp:Parameter Name="Photo_ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Photo_Name" Type="String" />
                <asp:Parameter Name="Photo_Intro" Type="String" />
                <asp:Parameter Name="Photo_Url" Type="String" />
                <asp:Parameter DbType="Date" Name="AddDate" />
                <asp:Parameter Name="Photo_ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Photo_Name" Type="String" />
                <asp:Parameter Name="Photo_Intro" Type="String" />
                <asp:Parameter Name="Photo_Url" Type="String" />
                <asp:Parameter DbType="Date" Name="AddDate" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:DataList ID="DataList1" runat="server" DataKeyField="Photo_ID" 
            DataSourceID="SqlDataSource1" RepeatColumns="3" RepeatDirection="Horizontal">
            <ItemStyle BorderStyle="Inset" BorderWidth="10px" />
            <ItemTemplate>
                图片编号:
                <asp:Label ID="Photo_IDLabel" runat="server" Text='<%# Eval("Photo_ID") %>' />
                <br />
                图片名称:
                <asp:Label ID="Photo_NameLabel" runat="server" 
                    Text='<%# Eval("Photo_Name") %>' />
                <br />
                图片介绍:
                <asp:Label ID="Photo_IntroLabel" runat="server" 
                    Text='<%# Eval("Photo_Intro") %>' />
                <br />
                图片内容:
                <asp:Image ID="Image1" runat="server" Height="95px" 
                    ImageUrl='<%# Eval("Photo_Url") %>' Width="117px" />
                <br />
                发布时间:
                <asp:Label ID="AddDateLabel" runat="server" Text='<%# Eval("AddDate") %>' />
                <br />
                <br />
            </ItemTemplate>
        </asp:DataList>
    
    </div>
    </form>
</body>
</html>
