⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usermanage.aspx

📁 一个简单的新闻后台管理系统
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserManage.aspx.cs" Inherits="UserInfo_FindUserInfo" %>

<!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>
        &nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:news_manageConnectionString4 %>"
            SelectCommand="SELECT [USERID], [USERNAME] FROM [t_News_User]"></asp:SqlDataSource>
        <table style="width: 787px; position: static">
            <tr>
                <td style="width: 100px; background-color: #507cd1; height: 26px;">
                    <asp:Label ID="Label2" runat="server" Style="position: static" Text="用户名:"></asp:Label></td>
                <td style="width: 100px; background-color: #507cd1; height: 26px;">
                    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
                        DataTextField="USERNAME" DataValueField="USERID" Style="position: static" Width="132px" AppendDataBoundItems="True">
                        <asp:ListItem Value="all">所有用户</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td style="width: 166px; background-color: #507cd1; height: 26px;">
                    <asp:Button ID="Button1" runat="server" Style="position: static" Text="搜索" OnClick="Button1_Click" /></td>
            </tr>
        </table>
        &nbsp;&nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1" AllowPaging="True" DataKeyNames="UserID" Height="20px" PageSize="5" Width="781px" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowDataBound="GridView1_RowDataBound" style="left: 14px; position: absolute; top: 96px" >
            <Columns>
                <asp:TemplateField HeaderText="编号" SortExpression="UserID">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("UserID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UserName" HeaderText="用户名" SortExpression="UserName" />
                <asp:TemplateField HeaderText="删除" ShowHeader="False">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False" CommandName="Delete"
                            ImageUrl="~/Image/icon_del.gif" Text="删除" OnClientClick="return confirm ('确定删除数据行?')" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ButtonType="Image" EditImageUrl="~/Image/edit.gif" HeaderText="编辑"
                    ShowEditButton="True" CancelImageUrl="~/Image/cancel.png" UpdateImageUrl="~/Image/update.png" />
                <asp:BoundField HeaderText="权限" DataField="userid" />
                <asp:TemplateField HeaderText="初始化密码">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        &nbsp;<asp:Button ID="Button2" runat="server" OnClick="Button2_Click1" Text="Button" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerSettings FirstPageText="第一页" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EFF3FB" />
            <EditRowStyle BackColor="#2461BF" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </div>
        &nbsp; &nbsp; &nbsp;
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="FindUserInfo"
            TypeName="UserObj" DeleteMethod="DeleteUser" UpdateMethod="UpdateUser">
            <DeleteParameters>
                <asp:Parameter Name="userID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="userID" Type="Int32" />
                <asp:Parameter Name="userName" Type="String" />
            </UpdateParameters>
        </asp:ObjectDataSource>
    </form>
</body>
</html>

⌨️ 快捷键说明

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