viewusers.aspx

来自「asp。net 2.0宝典一书源码 全书源码给大家共享」· ASPX 代码 · 共 36 行

ASPX
36
字号
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewUsers.aspx.cs" Inherits="admin_ViewUsers" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="MessageLabel" runat="Server" ForeColor="Red" Font-Size=".9em" />
            <asp:GridView ID="GridView1" runat="server" CellPadding="4" GridLines="None" AutoGenerateColumns="False"
                DataSourceID="SqlDataSource1" ForeColor="#333333" AllowPaging="True" AllowSorting="True">
                <FooterStyle ForeColor="White" BackColor="#507CD1" Font-Bold="True"></FooterStyle>
                <PagerStyle ForeColor="White" HorizontalAlign="Center" BackColor="#2461BF"></PagerStyle>
                <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#507CD1"></HeaderStyle>
                <SelectedRowStyle ForeColor="#333333" Font-Bold="True" BackColor="#D1DDF1"></SelectedRowStyle>
                <RowStyle BackColor="#EFF3FB"></RowStyle>
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />
                    <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" />
                    <asp:BoundField DataField="RoleName" HeaderText="RoleName" SortExpression="RoleName" />
                    <asp:BoundField DataField="RoleId" HeaderText="RoleId" SortExpression="RoleId" />
                    <asp:BoundField DataField="LastActivityDate" HeaderText="LastActivityDate" SortExpression="LastActivityDate" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
                SelectCommand="SELECT DISTINCT aspnet_Users.UserName, aspnet_Users.UserId, aspnet_Roles.RoleName, aspnet_Roles.RoleId, aspnet_Users.LastActivityDate FROM aspnet_Roles INNER JOIN aspnet_UsersInRoles ON aspnet_Roles.RoleId = aspnet_UsersInRoles.RoleId INNER JOIN aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId">
            </asp:SqlDataSource>
        </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?