📄 user.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="user.aspx.cs" Inherits="user" %>
<%@ Register Src="../pg.ascx" TagName="pg" TagPrefix="uc1" %>
<!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 bgcolor="inactivecaptiontext" scroll="auto" background="../img/x200662817362436940.jpg" style="text-align: center">
<form id="form1" runat="server">
<div style="text-align: center">
<span style="font-family: 隶书">用户ID:</span><asp:TextBox ID="txtid" runat="server"
Font-Names="隶书" Font-Size="Small" Width="69px"></asp:TextBox><span style="font-family: 隶书">用户姓名:</span><asp:TextBox
ID="txtname" runat="server" Font-Names="隶书" Font-Size="Medium" Width="77px"></asp:TextBox><span
style="font-family: 隶书">身份: </span>
<asp:DropDownList ID="drpident" runat="server" Font-Names="隶书" Font-Size="Medium">
<asp:ListItem Value="choose">请选择</asp:ListItem>
<asp:ListItem Value="Students">学生</asp:ListItem>
<asp:ListItem Value="Teachers">教师</asp:ListItem>
</asp:DropDownList><span style="font-family: 隶书">
<asp:Button ID="btFind" runat="server" Font-Names="隶书" Font-Size="Medium" Text="查找" OnClick="btFind_Click" /></span><asp:DataList ID="DataList1" runat="server" HorizontalAlign="Center"
RepeatDirection="Horizontal" Font-Bold="False" Font-Italic="False" Font-Names="隶书" Font-Overline="False" Font-Size="Medium" Font-Strikeout="False" Font-Underline="False" OnDeleteCommand="DataList1_DeleteCommand" OnCancelCommand="DataList1_CancelCommand" OnEditCommand="DataList1_EditCommand" OnItemDataBound="DataList1_ItemDataBound" OnUpdateCommand="DataList1_UpdateCommand" DataKeyField="UserID" OnItemCommand="DataList1_ItemCommand" Width="504px">
<HeaderTemplate>
<table>
<tr>
<td>用户ID</td><td> 用户名</td><td>密码</td><td>用户身份</td><td>修改</td><td>删除</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="UserIDLabel" runat="server" Width="60px" Text='<%# Eval("UserID") %>'></asp:Label></td>
<td><asp:Label ID="UserNameLabel" runat="server" Width="80px" Text='<%# Eval("UserName") %>'></asp:Label></td>
<td><asp:Label ID="UserPasswordLabel" runat="server" Width="60px" Text='<%# Eval("UserPassword") %>'> </asp:Label></td>
<td><asp:Label ID="UserIdentLabel" runat="server" Text='<%# Eval("UserIdent") %>'></asp:Label></td>
<td><asp:LinkButton ID="btmodify" runat="server" Text="编辑" Width="60px" commandname="edit" EnableViewState="true" /></td>
<td><asp:LinkButton ID="btdelete" runat="server" Text="删除" Width="60px" commandname="delete" /></td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr>
<td><asp:TextBox ID="txtUserIDText" runat="server" Width="60px" Text='<%# Eval("UserID") %>'></asp:TextBox></td>
<td><asp:TextBox ID="txtUserName" runat="server" Width="80px" Text='<%# Eval("UserName") %>'></asp:TextBox></td>
<td><asp:TextBox ID="txtUserPassword" runat="server" Width="60px" Text='<%# Eval("UserPassword") %>'> </asp:TextBox></td>
<td><asp:Label ID="lblUserIdent" runat="server" Text='<%# Eval("UserIdent") %>'></asp:Label></td>
<td><asp:LinkButton ID="btupdate" runat="server" Text="更新" commandname="update" Width="60px" EnableViewState="true" /></td>
<td><asp:LinkButton ID="btcancel" runat="server" Text="取消" Width="60px" commandname="cancel" /></td>
</tr>
</EditItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="6">
<hr size="1pt" color="blue" />
</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
<tr>
<td><asp:TextBox ID="id" runat="server" Width="60px" BorderStyle="None"></asp:TextBox></td>
<td><asp:TextBox ID="name" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="pwd" runat="server" Width="60px"></asp:TextBox></td>
<td><asp:DropDownList ID="drpIdent" runat="server" Width="60px">
<asp:ListItem Value="学生">学生</asp:ListItem>
<asp:ListItem Value="老师">老师</asp:ListItem>
</asp:DropDownList></td>
<td colspan="2"><asp:Button ID="btinsert" runat="server" Font-Bold="True" Font-Names="隶书" Font-Size="Medium"
Text="添加" Width="80px" CommandName="insert" /></td>
</tr>
</table>
</FooterTemplate>
<FooterStyle Font-Names="隶书"
Font-Size="Medium" HorizontalAlign="Center"
VerticalAlign="Middle" />
<EditItemStyle Font-Bold="False" Font-Italic="False" Font-Names="隶书" Font-Overline="False"
Font-Size="Medium" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
VerticalAlign="Middle" />
<ItemStyle Font-Names="隶书"
Font-Size="Medium" HorizontalAlign="Center"
VerticalAlign="Middle" />
<SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" />
<HeaderStyle Font-Names="隶书"
Font-Size="Medium" HorizontalAlign="Center"
VerticalAlign="Middle" />
</asp:DataList><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:courseConn %>"
SelectCommand="SELECT TeacherID AS UserID, TeacherName AS UserName, TeacherPwd AS UserPassword, '老师' AS UserIdent FROM Teachers UNION SELECT StudentID, StudentName, StudentPwd, '学生' AS Expr1 FROM Students">
</asp:SqlDataSource>
</div>
<uc1:pg ID="Pg1" runat="server" EnableViewState="true" />
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -