📄 question.aspx
字号:
<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="question.aspx.cs" Inherits="question" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center> </center>
<center>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="ThreadID" CaptionAlign="Left" CellPadding="4" ForeColor="#333333" GridLines="None">
<Columns>
<asp:BoundField DataField="ThreadID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ThreadID" />
<asp:BoundField DataField="Subject" HeaderText="标题" SortExpression="Subject" />
<asp:BoundField DataField="Content" HeaderText="内容" SortExpression="Content" >
<ItemStyle HorizontalAlign="Left" Width="50%" />
<ControlStyle Width="50%" />
</asp:BoundField>
<asp:BoundField DataField="Author" HeaderText="发问者" SortExpression="Author" />
<asp:BoundField DataField="TotalView" HeaderText="浏览次数" SortExpression="TotalView" />
<asp:BoundField DataField="Reply" HeaderText="回复次数" SortExpression="Reply" />
<asp:BoundField DataField="PostTime" HeaderText="提问时间" SortExpression="PostTime" />
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ButtonType="Button" />
</Columns>
<RowStyle HorizontalAlign="Left" BackColor="#F7F6F3" ForeColor="#333333" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Threads] WHERE [ThreadID] = @ThreadID" InsertCommand="INSERT INTO [Threads] ([Author], [Subject], [Content], [PostTime], [TotalView], [Reply]) VALUES (@Author, @Subject, @Content, @PostTime, @TotalView, @Reply)"
SelectCommand="SELECT * FROM [Threads] ORDER BY [PostTime] DESC" UpdateCommand="UPDATE [Threads] SET [Author] = @Author, [Subject] = @Subject, [Content] = @Content, [PostTime] = @PostTime, [TotalView] = @TotalView, [Reply] = @Reply WHERE [ThreadID] = @ThreadID">
<DeleteParameters>
<asp:Parameter Name="ThreadID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Author" Type="String" />
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Content" Type="String" />
<asp:Parameter Name="PostTime" Type="DateTime" />
<asp:Parameter Name="TotalView" Type="Int32" />
<asp:Parameter Name="Reply" Type="Int32" />
<asp:Parameter Name="ThreadID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Author" Type="String" />
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Content" Type="String" />
<asp:Parameter Name="PostTime" Type="DateTime" />
<asp:Parameter Name="TotalView" Type="Int32" />
<asp:Parameter Name="Reply" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
</center>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -