📄 user.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="user.aspx.cs" Inherits="admin_user" %>
<!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:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None"
BorderWidth="1px" CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource1"
GridLines="Horizontal" Width="500px">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
<HeaderStyle Width="130px" />
<ItemStyle Width="130px" />
</asp:CommandField>
<asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="id">
<ControlStyle Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="uid" HeaderText="帐号" SortExpression="uid">
<ControlStyle Width="120px" />
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="pwd" HeaderText="密码" SortExpression="pwd">
<ControlStyle Width="120px" />
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:TemplateField HeaderText="权限" SortExpression="qx">
<EditItemTemplate>
<asp:DropDownList ID="qxddl" runat="server" SelectedValue='<%# Bind("qx") %>'>
<asp:ListItem Value="0">系统管理员</asp:ListItem>
<asp:ListItem Value="1">普通管理员</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="qxddl" runat="server" SelectedValue='<%# Bind("qx") %>'>
<asp:ListItem Value="0">系统管理员</asp:ListItem>
<asp:ListItem Value="1">普通管理员</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:book %>"
DeleteCommand="DELETE FROM [admin] WHERE [id] = ?" InsertCommand="INSERT INTO [admin] ([id], [uid], [pwd], [qx]) VALUES (?, ?, ?, ?)"
ProviderName="<%$ ConnectionStrings:book.ProviderName %>" SelectCommand="SELECT * FROM [admin]"
UpdateCommand="UPDATE [admin] SET [uid] = ?, [pwd] = ?, [qx] = ? WHERE [id] = ?">
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="uid" Type="String" />
<asp:Parameter Name="pwd" Type="String" />
<asp:Parameter Name="qx" Type="String" />
<asp:Parameter Name="id" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="id" Type="Int32" />
<asp:Parameter Name="uid" Type="String" />
<asp:Parameter Name="pwd" Type="String" />
<asp:Parameter Name="qx" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -