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

SilverLight

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListAllUsers.aspx.cs" Inherits="ListAllUsers" %>
  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.     
  7.     <script language="javascript">
  8.     function fun(obj)
  9.     {
  10.      var a=document.getElementsByTagName("input").length;
  11.      
  12.      for(var i=0;i<a;i++)
  13.      {
  14.            if(document.getElementsByTagName("input")[i].type=="checkbox")
  15.            {
  16.               document.getElementsByTagName("input")[i].checked=obj.checked;
  17.            }
  18.      }
  19.     }
  20.     
  21.     </script>
  22. </head>
  23. <body>
  24.     <form id="form1" runat="server">
  25.     <div>
  26.         <asp:GridView ID="GridView1"  runat="server" AutoGenerateColumns="False" BackColor="White"
  27.             BorderColor="#336666" BorderStyle="None" BorderWidth="3px" CellPadding="4"
  28.             GridLines="Horizontal" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" >
  29.             <FooterStyle BackColor="White" ForeColor="#333333" />
  30.             <Columns>
  31.                 <asp:TemplateField HeaderText="全选">
  32.                     <HeaderTemplate>
  33.                         <input id="Checkbox1" type="checkbox"  onclick="fun(this)"/>全选
  34.                     </HeaderTemplate>
  35.                     <ItemTemplate>
  36.                         <asp:CheckBox ID="CheckBox1" runat="server" />
  37.                     </ItemTemplate>
  38.                 </asp:TemplateField>
  39.                 <asp:BoundField DataField="loginID" HeaderText="用户名" />
  40.                 <asp:BoundField DataField="loginpwd" HeaderText="用户密码" />
  41.                 <asp:BoundField DataField="name" HeaderText="姓名" />
  42.                 <asp:BoundField DataField="address" HeaderText="地址" />
  43.                 <asp:BoundField DataField="mail" HeaderText="邮箱地址" />
  44.                 <asp:BoundField DataField="phone" HeaderText="电话" />
  45.                 <asp:BoundField DataField="rolename" HeaderText="角色" />
  46.                 <asp:TemplateField HeaderText="状态">
  47.                     <EditItemTemplate>
  48.                         <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("statename") %>'></asp:TextBox>
  49.                     </EditItemTemplate>
  50.                     <ItemTemplate>
  51.                         <asp:LinkButton ID="LinkButton1" runat="server"  CommandArgument='<%# Eval("id") %>' Text='<%# Eval("statename")%>' CommandName="Click"></asp:LinkButton>
  52.                     </ItemTemplate>
  53.                 </asp:TemplateField>
  54.             </Columns>
  55.             <RowStyle BackColor="White" ForeColor="#333333" />
  56.             <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
  57.             <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
  58.             <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
  59.         </asp:GridView>
  60.         <br />
  61.         &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="启用用户" />
  62.         <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="禁止用户" /></div>
  63.     </form>
  64. </body>
  65. </html>