ListAllUsers.aspx
资源名称:SunShine.rar [点击查看]
上传用户:tjxpgg
上传日期:2017-05-14
资源大小:2244k
文件大小:3k
源码类别:
SilverLight
开发平台:
ASP/ASPX
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListAllUsers.aspx.cs" Inherits="ListAllUsers" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>用户状态管理</title>
- <script language="javascript">
- function fun(obj)
- {
- var a=document.getElementsByTagName("input").length;
- for(var i=0;i<a;i++)
- {
- if(document.getElementsByTagName("input")[i].type=="checkbox")
- {
- document.getElementsByTagName("input")[i].checked=obj.checked;
- }
- }
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
- BorderColor="#336666" BorderStyle="None" BorderWidth="3px" CellPadding="4"
- GridLines="Horizontal" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" >
- <FooterStyle BackColor="White" ForeColor="#333333" />
- <Columns>
- <asp:TemplateField HeaderText="全选">
- <HeaderTemplate>
- <input id="Checkbox1" type="checkbox" onclick="fun(this)"/>全选
- </HeaderTemplate>
- <ItemTemplate>
- <asp:CheckBox ID="CheckBox1" runat="server" />
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="loginID" HeaderText="用户名" />
- <asp:BoundField DataField="loginpwd" HeaderText="用户密码" />
- <asp:BoundField DataField="name" HeaderText="姓名" />
- <asp:BoundField DataField="address" HeaderText="地址" />
- <asp:BoundField DataField="mail" HeaderText="邮箱地址" />
- <asp:BoundField DataField="phone" HeaderText="电话" />
- <asp:BoundField DataField="rolename" HeaderText="角色" />
- <asp:TemplateField HeaderText="状态">
- <EditItemTemplate>
- <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("statename") %>'></asp:TextBox>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("id") %>' Text='<%# Eval("statename")%>' CommandName="Click"></asp:LinkButton>
- </ItemTemplate>
- </asp:TemplateField>
- </Columns>
- <RowStyle BackColor="White" ForeColor="#333333" />
- <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
- <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
- </asp:GridView>
- <br />
- <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="启用用户" />
- <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="禁止用户" /></div>
- </form>
- </body>
- </html>