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

📄 muser.aspx

📁 一个试题库设计
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MUser.aspx.cs" Inherits="Manager_MUser " MasterPageFile="~/TQMS_Master.master" %>
<asp:Content ID ="userContent" ContentPlaceHolderID="main" EnableViewState ="true" runat ="server">
    <table align="center" width="100%">
        <tr>
            <td colspan="3" height="30">
                用户信息管理</td>
        </tr>
                <tr>
            <td colspan="2" style="width: 694px; height: 27px;">
                按登录名:<asp:TextBox ID="tbxUserName" runat="server"></asp:TextBox>
                <asp:Button ID="btnSearch" runat="server" Text="查询" Font-Overline="False" Font-Strikeout="False" ForeColor="Black" OnClick="btnSearch_Click" />&nbsp;
                用户类型:<asp:DropDownList ID="DropDownList1" runat="server" Width="118px">
                    <asp:ListItem Value="admin">管理员</asp:ListItem>
                    <asp:ListItem Value="teacher">教师</asp:ListItem>
                    <asp:ListItem Value="student">学生</asp:ListItem>
                </asp:DropDownList>&nbsp;
                <asp:Button ID="btnsearch2" runat="server" OnClick="btnsearch2_Click" Text="查询" /></td>
        </tr>
        
        <tr>
         
           
            <td style="width: 694px" rowspan="2"  colspan="2" align="center">
                &nbsp;<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    DataKeyNames="TQ_UserID" DataSourceID="SqlDataSource1" OnRowEditing="GridView1_RowEditing" OnRowDeleted="GridView1_RowDeleted" BorderColor="MediumSlateBlue" >
                    <Columns>
                        <asp:BoundField DataField="TQ_UserID" HeaderText="编号" InsertVisible="False" ReadOnly="True"
                            SortExpression="TQ_UserID">
                            <ItemStyle Width="50px" />
                            <ControlStyle Width="50px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TQ_UserName" HeaderText="登录名" SortExpression="TQ_UserName">
                            <ItemStyle Width="80px" />
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TQ_TureName" HeaderText="姓名" SortExpression="TQ_TureName">
                            <ItemStyle Width="80px" />
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TQ_UserPwd" HeaderText="密码" SortExpression="TQ_UserPwd">
                            <ItemStyle Width="80px" />
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TQ_Email" HeaderText="邮箱" SortExpression="TQ_Email">
                            <ItemStyle Width="150px" />
                            <ControlStyle Width="150px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TQ_UserType" HeaderText="类型" SortExpression="TQ_UserType">
                            <ItemStyle Width="100px" />
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="编辑" ></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete" 
                                OnClientClick="javascript:return confirm('你确定要删除该用户吗?');"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <span style="font-size: 10pt">没有符合条件的查询结果,请更换查询条件或添加相关数据!!!</span>
                    </EmptyDataTemplate>
                </asp:GridView>
               </td>
        </tr>
        <tr>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <asp:Button ID="btnShowAll" runat="server" OnClick="showAll_Click" Text="显示全部"
                    Visible="False" Font-Strikeout="False" />
                    </td>
        </tr>
         <tr>
            <td colspan="3">
                <asp:HyperLink ID="hlkAddUser" runat="server" NavigateUrl="~/ShowUserInfo.aspx?action=add">添加用户</asp:HyperLink></td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:QuestionManagerConnectionString %>" SelectCommand="SELECT [TQ_UserID], [TQ_UserName], [TQ_TureName], [TQ_UserPwd], [TQ_Email], [TQ_UserType] FROM [TQ_UserInfo]"
         DeleteCommand="DELETE FROM [TQ_UserInfo] WHERE [TQ_UserID] = @TQ_UserID" >
        <DeleteParameters>
            <asp:Parameter Name="TQ_UserID" Type="Int32" />
        </DeleteParameters>
        
    </asp:SqlDataSource>
    &nbsp;
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:QuestionManagerConnectionString %>"
        SelectCommand="SELECT [TQ_UserID], [TQ_UserName], [TQ_TureName], [TQ_UserPwd], [TQ_Email], [TQ_UserType] FROM [TQ_UserInfo] WHERE ([TQ_UserName] = @TQ_UserName) ORDER BY [TQ_UserID], [TQ_UserType], [TQ_UserName]">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbxUserName" DefaultValue="" Name="TQ_UserName"
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:QuestionManagerConnectionString %>" SelectCommand="SELECT [TQ_UserID], [TQ_UserName], [TQ_TureName], [TQ_UserPwd], [TQ_Email], [TQ_UserType] FROM [TQ_UserInfo] WHERE ([TQ_UserType] = @TQ_UserType)">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="TQ_UserType" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>

⌨️ 快捷键说明

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