<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Height="23px" OnClick="Button1_Click" Text="返回" Width="60px" />
<asp:GridView ID="GridView1" runat="server" DataKeyNames="id,gjz,nr" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" AllowSorting="True" PageSize="15" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:BoundField DataField="id" HeaderText="编号" InsertVisible="False" ReadOnly="True" SortExpression="id" >
<HeaderStyle Wrap="False" />
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="gjz" HeaderText="关键字" SortExpression="gjz" >
<ItemStyle Font-Italic="False" HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="nr" HeaderText="内容" SortExpression="nr" />
<asp:CommandField ShowEditButton="True" HeaderText="编辑" >
<HeaderStyle Wrap="False" />
<ItemStyle Wrap="False" />
</asp:CommandField>
<asp:CommandField ShowDeleteButton="True" HeaderText="删除" >
<HeaderStyle Wrap="False" />
<ItemStyle Wrap="False" />
</asp:CommandField>
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:cctConnectionString %>"
SelectCommand="SELECT [id], [gjz], [nr] FROM [cct]"
DeleteCommand="DELETE FROM [cct] WHERE [id]=@id AND [gjz]= @gjz AND nr=@nr"
Insertcommand="INSERT INTO [cct] ( [id] , [gjz] , [nr]) VALUES ( @id, @gjz, @nr)"
UpdateCommand = "UPDATE [cct] SET [gjz]=@gjz, [nr]=@nr WHERE [id]= @id AND [gjz]=@gjz AND [nr]=@nr">
<DeleteParameters>
<asp:Parameter Name="id" Type ="String" />
<asp:Parameter Name="gjz" Type ="String" />
<asp:Parameter Name="nr" Type ="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="id" Type ="String" />
<asp:Parameter Name="gjz" Type ="String" />
<asp:Parameter Name="nr" Type ="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="gjz" Type ="String" />
<asp:Parameter Name="nr" Type ="String" />
<asp:Parameter Name="id" Type ="String" />
<asp:Parameter Name="gjz" Type ="String" />
<asp:Parameter Name="nr" Type ="String" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
