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

<!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 style="text-align:center">    
      <table style="width:80%" >
        <tr>
            <td colspan="2">
                我的博文</td>
        </tr>
        <tr>
            <td style="width:35%; text-align:left" rowspan="4">
               <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
               <HeaderTemplate>
                    <table style="width:100%">
                        <tr>
                            <td style="width:100%"> 
                                <b>标题</b>
                            </td>                                        
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table style="width:100%">
                        <tr>
                            <td style="width:100%">
                            <a href='Default2.aspx?ArticleID=<%#Eval("ArticleID") %>'>
                              <%#Eval("Title")%>
                            </a>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
               </asp:Repeater>
               <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:BlogConnectionString1 %>" 
                    DeleteCommand="DELETE FROM [Articles] WHERE [ArticleID] = @ArticleID" 
                    InsertCommand="INSERT INTO [Articles] ([Title]) VALUES (@Title)" 
                    SelectCommand="SELECT [ArticleID], [Title] FROM [Articles]" 
                    UpdateCommand="UPDATE [Articles] SET [Title] = @Title WHERE [ArticleID] = @ArticleID">
                   <DeleteParameters>
                       <asp:Parameter Name="ArticleID" Type="Int32" />
                   </DeleteParameters>
                   <UpdateParameters>
                       <asp:Parameter Name="Title" Type="String" />
                       <asp:Parameter Name="ArticleID" Type="Int32" />
                   </UpdateParameters>
                   <InsertParameters>
                       <asp:Parameter Name="Title" Type="String" />
                   </InsertParameters>               
               </asp:SqlDataSource></td>
            <td>
               <asp:Label ID="title" runat="server" Font-Size="16px"></asp:Label></td>
        </tr>
        <tr>
            <td>
               <asp:Label ID="PublishedTime" runat="server" Font-Size="12px"></asp:Label></td>
        </tr>
        <tr>
            <td>
               <hr  style="width:80%"/></td>
        </tr>
        <tr>
            <td style="text-align:left">
               <asp:Label ID="content" runat="server" Font-Size="14px"></asp:Label></td>
        </tr>
      </table>    
    </div>
    </form>
</body>
</html>
