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

SilverLight

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListBooksByCategory.aspx.cs" Inherits="ListBooksByCategory" %>
  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.     <script language="javascript">
  7.     function fun(obj)
  8.     {
  9.           var length=document.getElementsByTagName("input").length;
  10.           for(var i=0;i<length;i++)
  11.           {
  12.           if(document.getElementsByTagName("input")[i].type=="checkbox")
  13.           {
  14.           document.getElementsByTagName("input")[i].checked=obj.checked;
  15.           }
  16.           }
  17.     }
  18.     </script>
  19. </head>
  20. <body>
  21.     <form id="form1" runat="server">
  22.     <div>
  23.         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="852px" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" OnRowDataBound="GridView1_RowDataBound" ShowFooter="True" PageIndex="1">
  24.             <Columns>
  25.                 <asp:TemplateField>
  26.                     <EditItemTemplate>
  27.                         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  28.                     </EditItemTemplate>
  29.                     <HeaderTemplate>
  30.                         <input id="Checkbox1" type="checkbox" onclick="fun(this)"/>全选
  31.                     </HeaderTemplate>
  32.                     <ItemTemplate>
  33.                         <asp:CheckBox ID="CheckBox2" runat="server" />
  34.                     </ItemTemplate>
  35.                 </asp:TemplateField>
  36.                 <asp:BoundField HeaderText="书名" DataField="title" />
  37.                 <asp:BoundField HeaderText="作者" DataField="author" />
  38.                 <asp:BoundField HeaderText="类别" DataField="name" />
  39.                 <asp:BoundField DataField="id" HeaderText="编号" />
  40.             </Columns>
  41.             <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
  42.             <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
  43.             <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
  44.             <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
  45.             <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
  46.             <AlternatingRowStyle BackColor="#F7F7F7" />
  47.         </asp:GridView>
  48.         <br />
  49.         &nbsp;将书归入:<asp:DropDownList ID="DropDownList1" runat="server">
  50.         </asp:DropDownList>&nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
  51.             Text="修改" /></div>
  52.     </form>
  53. </body>
  54. </html>