Default3.aspx
上传用户:tjxpgg
上传日期:2017-05-14
资源大小:2244k
文件大小:2k
源码类别:

SilverLight

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5.     <title>无标题页</title>
  6. </head>
  7. <body>
  8.     <form id="form1" runat="server">
  9.     <div>
  10.         <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None">
  11.             <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  12.             <Columns>
  13.                 <asp:BoundField DataField="Title" HeaderText="书名" SortExpression="Title" />
  14.                 <asp:BoundField DataField="Author" HeaderText="作者" SortExpression="Author" />
  15.                 <asp:BoundField DataField="UnitPrice" HeaderText="售价" SortExpression="UnitPrice" />
  16.                 <asp:BoundField DataField="ContentDescription" HeaderText="简介" SortExpression="ContentDescription" />
  17.                 <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
  18.                     SortExpression="Id" />
  19.             </Columns>
  20.             <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
  21.             <EditRowStyle BackColor="#999999" />
  22.             <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
  23.             <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  24.             <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  25.             <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
  26.         </asp:GridView>
  27.     
  28.     </div>
  29.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" CacheDuration="3600" ConnectionString="<%$ ConnectionStrings:MyBookShopConnectionString %>"
  30.             EnableCaching="True" SelectCommand="SELECT [Title], [Author], [UnitPrice], [ContentDescription], [Id] FROM [Books]"
  31.             SqlCacheDependency="mybookshop;books"></asp:SqlDataSource>
  32.     </form>
  33. </body>
  34. </html>